Introduction
If you have a DateTime field in Crystal Reports, you will see Date and Time tab option on the Format Editor when you right-click on the field and select Format Field menu item. From the Date and Time tab, you may select the desired format and select OK.

Custom Date Format
If you do not see the desired format in the available list, you can also use the Customize button that launches Custom Style dialog.
The Custom Style dialog has three tabs - Date and Time, Date, and Time. The Date and Time are used to set the order of date and time using the Order drop-down and the Separator drop-down is used to set the separator.

On the Date tab, you can select the format of the date the way you want. At the bottom, you will see a preview of the date as well.

On-Time tab, you can select the format of time the way you want.

Formatting a Formula for Date
What if you have a formula that has DateTime value and you want to format it? In that case, you do not see the Date and Time tab on the Format Editor.
In this situation, you rely on your own code.
ToText function comes handy to do all formatting. For example, I need a date formatting as follows:
23-Mar-2007
The following formula will do the trick:
ToText({MYFIELDNAME }, "dd-MMM-yyyy")
I can simply move around the formatting to generate other formats. For example, if I need the following format:
Mar 23, 2007
I simply change the formula to the following:
ToText({MYFIELDNAME }, "MMM dd, yyyy")
And if I need format 03/23/07, I change the formula to "MM/dd/yy".

Nagaveni ValluriPosted Aug 24, 2017, 5:31 AM
ToText({MYFIELDNAME }, "MMM dd, yyyy") this will not work if MYFIELDNAME is not exists.i added check is null for MYFIELDNAME.it is saying field name is unknown.
Chetan NavalePosted Oct 19, 2012, 5:09 AM
Very good and helpful article specially the Formating formula for date section is interesting
sd ashwaqPosted Jul 2, 2010, 8:48 AM
I have some doubt how to display date wise data in crystal report when we select particular date i have written the code in formula field as given below "Day Book As On" + ToText({DT_DayBook.TDate})
Kiran KamblePosted May 6, 2010, 1:36 AM
hey thank u so mch for ur help........changing date format to display,it ws sch a simple thing to do bt since m developing website in .net n using crystal report 1st time so wsnt aware of this thing... Thank UUUUUUUU so mch.....
MimiPosted Dec 16, 2009, 8:59 PM
Hi, How may I use totext above to show the full month's name? Example, January, February, etc? Use M? Thank you.
Ankur SangwanPosted Oct 1, 2009, 8:26 AM
A date-time is required here. Error in File C:\Users\KKF548~1.SAN\AppData\Local\Temp\CrystalReport {F45C6D56-0419-4FD3-8D8F-C2ABCFB62D5A}.rpt: Error in formula . '{command_2.DistrictName}='Lucknow' and {command_2.expenseDate}='9/17/2009 12:00:00AM'' A date-time is required here.
Ankur SangwanPosted Oct 1, 2009, 6:52 AM
A date-time is required here. Error in File C:\Users\KKF548~1.SAN\AppData\Local\Temp\CrystalReport {C2D9C8B3-2F48-4EDE-9727-2B6CFC7C091F}.rpt: Error in formula . '{command_2.DistrictName}='Lucknow' AND {command_2.expenseDate}='01/01/2009'' A date-time is required here.
Panna SinhaPosted Dec 13, 2007, 2:00 AM
Hi , i got this article very helpful. but i need to be able to change the date format dynamically so that whatever the format customer selects, the reports show the selected format. Can u help me out in this regard ? Thanks & Regards Pannalal sinha
Rolston LopesPosted Jul 4, 2007, 3:51 AM
I have a group in a report with Top 5 sales with a running total. I want to add another column with a ratio of sales to running total (which is the total of all top 5 sales) How can we accomplish this. Please advice.