Sum short time

  • Thread starter Thread starter Charley Goddard
  • Start date Start date
C

Charley Goddard

Guest
Help !!

I have a problem that my report will not sum correctly the total time values. My table holds the start time and end time in short date format and my query calulates the time elasped.

Length of time: 1+[Time of Departure]-[Time of Arrival]

as the duration of time exceeds 24hrs I am having a problem. Most of the threads that I have read to possibly solve this require the field to hold both the date and time. At current the date is in a seperate field.

Pls Help, this is driving me nutts !!
 
Last edited:
Hi Charley

I'm not sure if this will help but assuming the difference between the arrival time and departure time can not exceed 24 hours, and assuming the arrival time occurs before the departure time (e.g. like in an airport transit lounge), then use the following in your query to work out the difference (in minutes) :

DateDiff("n",[ArrTime],[DepTime])+IIf([ArrTime]>[DepTime],1440,0)

Make sure you use your actual field names where I used 'Arrtime' and 'DepTime'.

If the arrival time occurs after the departure time (I assumed the other way around, but the other way around would be for the time spent travelling), then swap the Arrival & Departure fields around in my expression.

HTH, Andrew :)
 
Thanks

That worked perfect, thanks
 

Users who are viewing this thread

Back
Top Bottom