Number of minutes between 2 dates/times (1 Viewer)

gcormier

Registered User.
Local time
Today, 22:52
Joined
May 31, 2000
Messages
13
I'm desperate to know if anybody has an answer re: how to perform cacluations on date/time fields for times that run over midnight. Here's an example for calculating duration of time for "treatment":

Treatment Start Time (Field: time_tx_start): 10/1/2002 @ 23:59
Treatment End Time (Field: time_txend): 10/2/2002 @ 01:02

The query I have set up to determine length of tx duration is as follows:

tx_duration: DateDiff("n",[time_tx_start],[time_txend])

However, for the previous example, this query gives me the following 4-digit #:

-1377

I have then been converting this # in excel by adding 1440 (the number of minutes in 1 day), to get the true treatment duration time of 63 minutes. Free Enron stock to anyone who knows of a less cumbersome way!! (Just kidding), but I would be very greatful!!
 

Tim K.

Registered User.
Local time
Today, 22:52
Joined
Aug 1, 2002
Messages
242
I have try the bit below and turned out OK.

? DateDiff("n",#10/1/2002 23:59#,#10/2/2002 01:02#)
63

You probably left the # sign out?
 

Users who are viewing this thread

Top Bottom