Time Calculations

J

joe

I need to calculate the duration of time between values in two fields. Both
fields are in the form of MM/DD/YY 00:00 I've tried a few times w/o much
success.
 
D

Douglas J. Steele

To get the difference in seconds, you can use DateDiff("s", DateField1,
DateField2).

Once you know the difference in seconds, you can figure out what it is in
other units using arithmetic.
 
R

Rick Brandt

joe said:
I need to calculate the duration of time between values in two
fields. Both fields are in the form of MM/DD/YY 00:00 I've tried a
few times w/o much success.

DateDiff() function is explicitly for that purpose.
 
M

Marshall Barton

joe said:
I need to calculate the duration of time between values in two fields. Both
fields are in the form of MM/DD/YY 00:00 I've tried a few times w/o much
success.


First, you need to determine what units you want for the
duration, then you cab use the DateDiff function to
calcualate the result. For example, if you want the result
in minutes, DateDiff("n", earliervalue, latervalue)

See Help for details and post back if you need further
assistance.
 
Top