Time

maxmangion

AWF VIP
Local time
Today, 06:56
Joined
Feb 26, 2003
Messages
2,805
I have 2 fields which contains a start time and an end time (the difference between the two is usually between 1 to 6 hours). However, I am noticing that the data, in my fields are in the following format:

eve_stime eve_etime
01/01/1900 16:00:00 01/01/1900 17:29:00
01/01/1900 17:30:00 01/01/1900 18:59:00


From the above example, i would like a new field which simply shows me the difference between the two times, in the above examples it should be approx 1.5

Any ideas on the best procedure to tackle this ?

Thank You
 
Try the Expression

Difference: Round((DateDiff("n",[StartTime],[EndTime]))/60,2)

in a query.

JC
 
Thanks for the expression, it worked perfectly. However the last thing which i would like to do if it is possible, since the time are 16:00 - 1729, for example, the result is 1.48 (as expected) ... is there a way in which i could round it to 1.5. Similarly if the the result would be 0.98, I would like it to be 1. Is this possible pls ?

Thank You
 
You can just change the rounding to 1 like so

Difference: Round((DateDiff("n",[StartTime],[EndTime]))/60,1)

This would mean as in all rounding it rounds to the nearest 10th. Up or down. Is this ok?

JC
 

Users who are viewing this thread

Back
Top Bottom