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

Difference between 2 Date Time fields

Status
Not open for further replies.

Millstone

IS-IT--Management
Oct 10, 2001
3
GB
Hi,

I need a report which shows response times to web requests - I have a datetime field for RequestedAt and another for ActionedOn.

Does anyone know how to take these 2 datetime fields, and produce a formula to give me the difference between them in Hours and Minutes???

Matt.
 
Hi,

The following formula should work

local numbervar n := {date_time_1} - {date_time_2);
local numbervar h := Truncate(n / 3600);
n := Remainder(n,3600);
local numbervar m := Truncate(n / 60);
local numbervar s := Remainder(n,60);
totext(h,"00")+":"+totext(m,"00")+":"+totext(s,"00")

Hth,
Geoff
 
Hi,

Correction to above ...

local numbervar n := {date_time_1} - {date_time_2);
n = n * 24 * 60 * 60

Need to do this to convert to seconds !

Geoff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top