Search code examples
datetimecrystal-reports

Convert Date String to Date Type


How can I convert a string field formatted as 2017/09/08 00:00:00:00 to a date type that reads 09/08/2017?


Solution

  • As you mentioned, DTStoDate{yourStringhere} is the in-house solution.

    Otherwise, filter out the blank time data by taking only the 10 leftmost characters of that string. Then cast it: DateValue(Left({yourStringhere},10))