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!

Totaling Hours and minutes

Status
Not open for further replies.

33216CLC

Programmer
Aug 17, 2000
173
BS
How do I total 10.55 (which is actually 10 hours and 55 mins) and 2.10 (2 hours and 10 minutes) to equal 13.05 (actually 13 hours and 5 minutes) in crystal reports.

I am pulling the data from an access database.
 
You have to split this into two fields:

Hours:
Truncate (Field)

and Minutes:

Field - Truncate(Field)

You can then total these separately and then use the grand totals to get total hours and minutes:

Total Hours:

Sum(Hours) + Truncate(Sum(Minutes)/60)

Total Minutes:

Sum(Minutes)/60 - Truncate(Sum(Minutes)/60)

I didn't get to test these, but they look right.
Let me know if they don't work. Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top