• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1096
  • Last Modified:

Format Date/Time field in Crystal Reports

I am using the folloing formula to populate a 'data date' for a report:
formula = "Data Dates from " + totext(minimum({@closed time})) + totext(maximum({@closed time}))
The output in crystal is good:
Data Dates from 4/1/2005 13:59:49 to 4/27/2005 14:43:13
But, when I run put the report in a vb.net project the output changes to:
Data Dates from 05-04-01 01:59:49 PM to 05-04-27 02:43:13 PM

This date is confusing to users so I would like the output to be MM/DD/YYYY not YY-MM-DD, how do I go about formatting this??
1 Solution
Brian CroweCommented:
try this to force the format...

formula = "Data Dates from " + totext(minimum({@closed time}), "M/d/yyyy HH:mm:ss") + " to " +
     totext(maximum({@closed time}), "M/d/yyyy HH:mm:ss")
That looks like the way to go.  Would appear in Crystal it is using your Crystal defaults but from VB your system default formats.

mikevereAuthor Commented:

I ended up using:
formula = "Data Dates from " + totext(minimum({@closed time}), MM/dd/yyyy) + " to " +
     totext(maximum({@closed time}), MM/dd/yyyy)

Works great, thanks!!

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now