Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Time in Crystal Report 4.6.1.0

Status
Not open for further replies.

mans

Programmer
Mar 18, 2000
136
AU
Hello,<br><br>I have been trying for some time to represent time rather than date in crystal reports 4.6.1.0 from Access2000 (Date/Time format) without any luck at all.&nbsp;&nbsp;I have gone through the Report Option section under File and made the necessary change but I cannot find any DTS functions to allow me to change the display from date and time to just time.&nbsp;&nbsp;Basically, can somebody please let me know the necessary steps to display time in CR 4.6.1.0.<br><br>Thank you
 
I'm not sure if this works the same in CR 4, but in CR 6 go to the report menu and choose Change Group Expert. It will bring up a window. Select the Group you want to change and click Options. In the Group Options part of the window choose Customize Group Field Name and Use a Formula Group Name. Click on the formula button and enter the formula CStr (CTime ({<field>})). This will change your <field>, that is a DateTime, to just a Time and then convert that Time to a String that will be put in your report.

Hope this helps!
Evie
 
If you just want it for display purpose, you can tailor the following formula.

My format is 01/01/2000 12:00:00AM, stored as string.

first I seprate out the time:

stringVar GetDate ;

GetDate := right(GetDate, InStr (GetDate, ':') -3);

then I get rid of the AM/PM:

GetDate := left(GetDate, length (GetDate)-2) ;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top