Custom field formula - Adding CStr(DateObject) to String object creates unreadable date? RRS feed

  • Question

  • We have a problematic custom field named Gate Last Passed that is using the following formula to derive the latest Gate Date and Gate number from a project plan:

    IIf(ProjDateValue('NA') <> [Last Gate Date Calc], "G" + CStr([Last Gate Calc]) + ", " + CStr([Last Gate Date Calc]), "G" + CStr([Last Gate Calc]) + ", " + "NA")

    However, the CStr() function is converting the date object into an illegible double.  For example, 6/28/12 = 41086.3333333. How can I accomplish this string concatenation with a Date object without losing the Date formatting?

    • Edited by TimeBomb006 Thursday, March 26, 2015 7:54 PM
    Thursday, March 26, 2015 7:15 PM

All replies

  • Dylin --

    Your problem may be caused by the fact that dates also carry the time of day.  Because of this, you need to capture only the date portion of the date and time value.  To do this, you might try using the following in your formula:

    CStr(DateValue([Last Date Calc]))

    Worth a try.  Hope this helps.

    Dale A. Howard [MVP]

    Friday, March 27, 2015 2:06 AM