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

Time calculation help

Status
Not open for further replies.

haneen97

Programmer
Dec 10, 2002
280
US
Hi team, (Running CR 8.5 with Oracle DB)

I am generating the time from a text field like this:

Elapsed time = (datediff("S", {@TIME_IN},{@TIME_OUT}); )

MIN fields has this code (Remainder(Truncate({@ELAPSED_TIME}/60),60);)

HRS field has this code (Truncate(Truncate({@ELAPSED_TIME}/60)/60);)

They are concatenated in RPT_TIME_DIFF like this ({@HRS}+{@MIN} )

The difference is messed up if the elapsed time is more than an hour. I think because the minutes are coming out like this (05.00) for five minutes. So if the elapsed time is 1 hour and 5 minutes it is subtracting (01:00 - 05:00).

How can I get the minutes to display like this (00:05).

Thanks a lot.

Mo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top