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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TIME FORMAT IN CRYSTAL

Status
Not open for further replies.

ronkus

Technical User
Mar 3, 2004
1
GB
Please i would need any suggestions of help reagarding this.

I have a TIME field which, when generated in Crystal with the formula created for it, it populates the wrong time, the reason why i would need a time formula is so that it does not generate the field in a number format.
The formula created is:

DateAdd('s',{Incident_Managemnt_Form.From_x},#00:00:00#)
therefore if the correct time for a particular case is 15:00, it generates the report as 14:00. It is the same for all the other reports for a time field.
Guess there is something missing in the formula i have written. please reply soon.

Thanks
 
If you need to convert seconds to a HH:MM:SS, then use the following.

If you're trying to fabricate some sort of time, I've no idea what you're trying to do.

whileprintingrecords;
numberVar dur:=,{Incident_Managemnt_Form.From_x};
numberVar hrs;
numberVar min;
numberVar sec;
stringVar hhmmss;

hrs := Truncate(Truncate(dur/60)/60);
min := Remainder(Truncate(dur/60),60);
sec := Remainder(dur,60);

//hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00.0", 1);
hhmmss := totext(hrs, "0") + ":" + totext(min, "00") + ":" + totext(sec, "00");

hhmmss

-k kai@informeddatadecisions.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top