Date/Time Fields

  • Thread starter Thread starter Lydia Thompson
  • Start date Start date
L

Lydia Thompson

Have made table with 5 date/time fields. Fld names hold
times patient moves through ED. Need to be able to get
hours and minutes and perform calculations on these times.
The code I am using sets off 2 errors one that won't show
a time if field is blank and the other that time is not
right format for calculations. Any help would be
appreciated.
 
Have made table with 5 date/time fields. Fld names hold
times patient moves through ED. Need to be able to get
hours and minutes and perform calculations on these times.
The code I am using sets off 2 errors one that won't show
a time if field is blank and the other that time is not
right format for calculations. Any help would be
appreciated.

Care to post your code, and the actual error messages? It's more than
a bit difficult to tell what you're doing wrong when you don't tell us
what you're doing!
 
Lydia Thompson said:
Have made table with 5 date/time fields. Fld names hold
times patient moves through ED. Need to be able to get
hours and minutes and perform calculations on these times.
The code I am using sets off 2 errors one that won't show
a time if field is blank and the other that time is not
right format for calculations. Any help would be
appreciated.

Maybe this might help you. It's very simple but it works!

I have 3 fields:

StartTime, EndTime, TotalTime.

All have the Format in Properties: 00:00;0;_ so you can just type the
time as
like 1200 or 1345. It formats itself.

In Properties - Data: for the TotalTime filed

ControlSource: =[StartTime]-[EndTime]*60/60+24

You do have to use military times.

If you would type in StartTime: 13:00 and in EndTime: 15:00
(that’s all PM, same day) the result will be 2:00. 2 hours.

If you would type in StartTime: 13:00 and in EndTime: 09:00
(that’s AM, next day) the result will be 20:00 20 hours.

you can also use the minutes. like 12:01 to 13:17 = 1:16 or
12:01 to 9:47 = 18:46


hope it helps
 
Back
Top