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

Format time and calculate time between

Status
Not open for further replies.

laina222

Technical User
Sep 7, 2001
172
US
I have pulled data into a report where I have two fields that are different times, and I need to calculate the time between them. I have encountered two problems:
1) I cannot format the time field from HHMMSS into HH:MM:SS. Right now all the values look like 5 or 6 digit numbers. If I simply try to format the cell using "Format Cell", everything changes to "12:00:00 AM". I need some sort of VB code for my variable.
2) Once I have those fields formatted, I don't know how to calculate the time between them.
If anyone has done this before, or knows how to do one or both parts, that'd be great. Any help is appreciated. Thanks in advance.
 
I figured out the format. It's
=FormatNumber(<Time> ,"00:00:00")

It's the calculation part I'm still working on!
 
Please post technical information:

Crystal version
Database/connectivity used
Example data (show the time data type and an example
Expected output

I have a FAQ on displaying the data:

faq767-3543

-k
 
Business Objects v 5.1.6
DB2
Example data: 08:30:30
11:45:40
Expected output: 3:15:10
 
This is a Crystal Reports forum, try posting in the Business Objects forum:

forum393

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top