DateDiff between days

R

Ryan W

I have two txt Boxes, start time and end time. In a query I want to know in
minutes the difference in time. I know the syntax: DateDiff("n",
[starttime],[endtime])

What happens if my start time is 2350 (11:50 p.m.) and end time is 0130
(1:30 a.m.) the next day? How can I handle that it changed days?
 
R

Rick Brandt

Ryan said:
I have two txt Boxes, start time and end time. In a query I want to
know in minutes the difference in time. I know the syntax:
DateDiff("n", [starttime],[endtime])

What happens if my start time is 2350 (11:50 p.m.) and end time is
0130 (1:30 a.m.) the next day? How can I handle that it changed days?

It will still work IF you enter the date and time. Otherwise it will return a
negative value. YOu might be able to use IIF() to add one day to the end time
whenever it is less that the start time.
 
R

Ryan W

I will try that and let you know. Thanks for your time, Ryan

Rick Brandt said:
Ryan said:
I have two txt Boxes, start time and end time. In a query I want to
know in minutes the difference in time. I know the syntax:
DateDiff("n", [starttime],[endtime])

What happens if my start time is 2350 (11:50 p.m.) and end time is
0130 (1:30 a.m.) the next day? How can I handle that it changed days?

It will still work IF you enter the date and time. Otherwise it will return a
negative value. YOu might be able to use IIF() to add one day to the end time
whenever it is less that the start time.
 
Top