Queries by time

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm looking to add a queries that would let me know when a arrival time was
"late or "on time"

Any help on the would be appreciated
 
If both the estimated and actual arrival times are columns in the table then
you can compare them as the first argument of an IIF function call and return
the appropriate string, e.g.

SELECT EstimatedArrivalTime, ActualArrivalTime,
IIF(ActualArrivalTime > EstimatedArrivalTime, "Late", "On time") As Message
FROM Arrivals;

Note that the 'times' must all be entered as full date time values. If only
the times are entered then the above query will fail if the times span
midnight. This is because if a time without a date is entered into a date
time column the value in the column will actually be the time on 30 December
1899, which is day zero in Access's implementation of date time data.

Ken Sheridan
Stafford, England
 
Back
Top