Reformatting date formulas to show on reports in either US or UK format or with optional extras such as name of the month or name of the weekday.
Open the report in Crystal Reports.
In the Field explorer expand the formula fields and locate the field you would like to modify. Right click and then Edit...
You should now see the formula in the Formula Editor with the last line being something such as:
Date (yyyy, mm, dd)
It might be others such as CurrentDate or CDate or so on. The common thing with all of these is that it returns a crystal date format.
If you pass a crystal date format to ToText function you can specify how to show the date information.
For example if you had the Date (yyyy, mm dd) and it was returning 6/18/2008 if you added the ToText function like this:
ToText (Date (Yyyy, Mm, Dd), "dddd, dd MMMM yyyy")
It would then be returning: Wednesday, 18 June 2008
The seconds string "dddd, dd MMMM, yyyy" is the date formatting string, here are all the possible characters you can use to format the output to what ever the requirements.
d - Day of month without leading zero for single digits
dd - Day of month with leading zero for single digits
ddd - Day of week as three letter abbreviation
dddd - Full name of day of week
M - Month without leading zero for single digit
MM - Month with leading zero for single digit
MMM - Month as three letter abbreviation
MMMM - Full name of month
yy - Last two digits of year
yyyy - Full four digits of year