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

Calculating difference between 2 time fields

Status
Not open for further replies.

optiplex

Technical User
Jul 21, 2000
2
SE
I have 2 time fields(short time) and I like to calculate the difference between them in a third field.
I've done two tests:

LastTime-FirstTime=1.03
(format of the 3rd field is short time)
LastTime-FirstTime=0,04375
(none format of the 3rd field selected)

What kind of format must I use in the third field to get the difference in minutes. I'm using 24hr clock.

/opti

 
Use the DateDiff() function. This will give you the number of minutes between the two times:

DateDiff("n", FirstTime, SecondTime)
 
You could also try this, to get a "Datr/Time" formatted varaible.

? Format(DateDiff("n", FirstTime, SecondTime)/1440, "Short Time")


MichaelRed
mred@duvallgroup.com
There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top