DateAdd DateDiff Help

srburk

Registered User.
Local time
Yesterday, 21:12
Joined
Dec 31, 2002
Messages
32
I have three time fields.

Field 1 displays the time of the patient's arrival.
ARRIVAL

The goal would be for the patient to be seen by the physician within thirty minutes of arrival. Therefore, I created a second field showing the arrival plus thirty minutes.

Field 2:
GOAL: DateAdd("n",15,[ARRIVAL])

Field 3 displays the time that the physician actually began seeing the patient.
PHYSICIAN

NOW - What I'd like to do is compare the goal verses the time the physician actually saw the patient. I'd like to see how many minutes early/late (eg. -5,-4,-3,-2,-1,0,1,2,3,4,5)

This is what I did for the calculation:
RESULT: DateDiff("n",[GOAL],[PHYSICIAN])

Unfortunately, the only result is 15. Can anyone help?
 
What values for ARRIVAL are you testing with?

Should this:
GOAL: DateAdd("n",15,[ARRIVAL])

Be:
GOAL: DateAdd("n",30,[ARRIVAL])
?
 
Yes, my typo...
GOAL: DateAdd("n",30,[ARRIVAL])

However, I am hoping for the result to show the minutes in difference between the two.

For example:

ARRIVAL was at 2:00PM
GOAL would be 2:30PM
PHYSICIAN saw the patient at 2:25PM

The RESULT should show -5 since the physician began seeing the patient five minutes before the goal.

Instead, it shows 30 for each result.
 
Well, here is what I'm using:
Arrival:
11/01/01 12:45:00 PM

Physician:
11/01/01 1:35:00 PM

Calculations ...:
GOAL: DateAdd("n",30,[ARRIVAL]) .... returns:
11/01/01 1:15:00 PM

RESULT: DateDiff("n",[GOAL],[PHYSICIAN]) .... returns:
20

Seems to work for me ...

Are your data types for ARRIVAL and PHYSICIAN Date/Time?
 

Users who are viewing this thread

Back
Top Bottom