I am looking for a way to convert a string which appears as a time 103030 (this is actually 10:30:30) to a time value so that calculations can be preformed on the field. I am using Crystal Reports XI. Thanks for your help.
You can use the picture function to map it to the proper date format and then use the CTime() function to convert it to a time data type.
CTime(Picture(, "xx:xx:xx"))
Then use the DateAdd() function to do calculations on the field.
I have all the Crystal Reports functions documented with sample code in Chapter 6 of my Crystal Reports Encyclopedia book
Edited by BrianBischof - 28 Nov 2007 at 1:56pm
Thank you for your help. When I use the CDate formula as you have suggested the field on the report is blank. Any suggestions?
That should be CTime() instead of CDate(). I originally wrote CDate() in my post but then changed it to CTime() once I read your question a second time. That should get you up and running.
Edited by BrianBischof - 28 Nov 2007 at 2:29pm
This page was generated in 0.016 seconds.