Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to convert datetime format to date format in crystal report using C#?

i am working c# windows form application and also in crystal report.i am retriving the date from database in datetime format but i like display date only in report,Is any formula field in crystal report help for me for this problem.Thanks in Advance.

like image 332
ratty Avatar asked Jan 30 '26 21:01

ratty


1 Answers

If the datetime is in field (not a formula) then you can format it:

  1. Right click on the field -> Format Editor
  2. Date and Time tab
  3. Select date/time formatting you desire (or click customize)

If the datetime is in a formula:

ToText({MyDate}, "dd-MMM-yyyy")
//Displays 31-Jan-2010

or

ToText({MyDate}, "dd-MM-yyyy")
//Displays 31-01-2010

or

ToText({MyDate}, "dd-MM-yy")
//Displays 31-01-10

etc...

like image 86
Nathan Koop Avatar answered Feb 02 '26 11:02

Nathan Koop



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!