Calculate time across midnight in ms access
--------------------------------------------------------------------------
Hi,
I have created a database to store patient arrival date, arrival time and departure time.
I am trying to set up a query to calculate the total waiting time for each patient from arrival time to departure time.
At the minute I can calculate the total waiting time in minutes by:
Minutes: DateDiff("n",[Time Arrived],[Time Left Department])
and the total waiting time in hours and minutes by the following:
Waiting Time: [Minutes]\60 & Format([Minutes] Mod 60,"\:00")
But this does not work accross midnight, as it gives a negative time for anyone seen before midnight and discharged after midnight.
Any help much appreciated.
--------------------------------------------------------------------------
Hi,
I have created a database to store patient arrival date, arrival time and departure time.
I am trying to set up a query to calculate the total waiting time for each patient from arrival time to departure time.
At the minute I can calculate the total waiting time in minutes by:
Minutes: DateDiff("n",[Time Arrived],[Time Left Department])
and the total waiting time in hours and minutes by the following:
Waiting Time: [Minutes]\60 & Format([Minutes] Mod 60,"\:00")
But this does not work accross midnight, as it gives a negative time for anyone seen before midnight and discharged after midnight.
Any help much appreciated.