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

Running total for Time field in Crystal 8.0 1

Status
Not open for further replies.

EagerBeaver

Technical User
Apr 16, 2001
39
US
I need help inserting a total (sum) field for a time Value. The time value in the database has hours..minutes..seconds.. I want to insert a total time for each group and them a grand total for all the groups.

Your help is appreciated.
 
What data type is the existing time field?
What does a sample value look like?
What format do you want the total to take?
What version of CR?
Ken Hamady
Crystal Reports Training/Consulting and a
Quick Reference Guide to VB/Crystal (including ADO)
 
I am using Crystal 8.0

The data is in time format not text

here is a sample: 000:00:30:00 This would equal 30 minutes.

The form I want it to take is the same as the input form.
 
I have been struggling with this for several days. I have the same basic questions as the one asked here except my time field starts out as text. For instance, I need to add up time fields like 2:15 + 3:30 + 0:15 so that I get 6:00 hrs in this case. My data comes from an Access table where I calculated the difference between the Start_Time field and the End_Time field to get the time fields that I am now trying to total. Start_Time and End_Time are both date/time fields. Should I have used a different way to go about this? Please help.
 
If you still have access to the original fields Start Time and End Time then you can let CR subtract one from the other, and then add up the differences. You can convert this total to seconds and then use my formula in the FAQ on common formulas to convert seconds to Hours:Minutes:Seconds.

Alternately, you can use the VAL function to convert your hours and minutes to numbers, multiply them out to get to seconds, add them up and do the same thing.

Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top