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

Calculate date and hours between start and end

Status
Not open for further replies.

T1na

MIS
Oct 28, 2003
15
0
0
GB
In Crystal 11 I would like to calculate the date and hours between a start{datetimefield} and end {datetimefield}. I know about the datediff but need a little help with the time.
 
datediff("h",{table.start},{table.end})

This would return a result in hours. Then you could return days by using:

truncate({@datediff}/24)

The remaining hours would then be:

remainder({@datediff},truncate({@datediff}/24))

-LB
 
You can always use this:

({end time field} - {start time field})*24 = 0.00 (hrs and .00 mins) use *1440 if you want it in whole minutes.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top