Print Page | Close Window

Formatting text as a date

Printed From: Crystal Reports Book
Category: Crystal Reports .NET 2003
Forum Name: Writing Code
Forum Discription: .NET 2003 programming API, report integration
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20750
Printed Date: 29 Mar 2024 at 12:33am


Topic: Formatting text as a date
Posted By: stevetothink
Subject: Formatting text as a date
Date Posted: 19 May 2014 at 8:28am
I have a text field storing dates, such as 06/01/2016. How can I get crystal to convert this text field to an actual date format of MM/DD/YYYY when running a report?

Also - is it possible to code crystal so it recognized 6/1/14 as MM/DD/YYYY?

Thanks,
Steve



Replies:
Posted By: stevetothink
Date Posted: 19 May 2014 at 10:18am
I fished my wish - found it by searching online a little more extensively.

If IsDate ({table.DateField}) Then
    CDate ({table.DateField})
Else Date (0, 0, 0);


Posted By: jessicacyrus1
Date Posted: 15 Jun 2016 at 1:28am
Thank you for posting the answer it will be help full to me and many others also. because I also Don't have Idea about it.

-------------



Print Page | Close Window