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!

Formula for Calculating Elapsed time using Military time

Status
Not open for further replies.

schaferr

MIS
Oct 16, 2001
12
US
I am working with a DBIV database that has two fields used for time in and time out of a visit. These fields are not defined as date/time fields. They are numeric fields and the time stored in them is military time. I need help creating a formula to determine the elasped time. An example of the fields and desired result is as follows:

TimeIn: 1230
TimeOut: 1430

Desired result is 120.

Using Crystal 8.5

Thanks
 
Try this:

WhilePrintingRecords;
numbervar hrs := truncate({@TimeOut}/100) - truncate({@TimeIn}/100);
numbervar mins := remainder({@TimeOut},100) - remainder({@TimeIn},100);
hrs*60 + mins

Howard Hammerman,

Crystal Reports training, consulting, books, training material, software, and support. Scheduled training in 8 cities.
howard@hammerman.com
800-783-2269
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top