Subtracting Time Fields

  • Thread starter Thread starter PeteVTX
  • Start date Start date
P

PeteVTX

Can anyone help?

I have two time fields (startTime and endTime) and a LunchPeriod field which
is an integer field holding minutes. Can anyone tell me the best way to
subtract StartTime from endTime and then subtract the LunchPeriod minutes to
obtain total hours worked in the day?

Any help appreciated.

regards

Pete
 
hi PeteVTX,

u make a query. then u type this

SELECT table1.[start time], Table1.[end time], DateDiff("n",[start
time],[end time]) AS [total minutes], Table1.lunch, [total minutes]-[lunch]
AS wh, [wh]\60 & Format([wh] Mod 60,"\:00") AS [total wh]
FROM Table1;

table1 is your table name. then you can get the answer. hope this can help
you.
 
Can anyone help?

I have two time fields (startTime and endTime) and a LunchPeriod field which
is an integer field holding minutes. Can anyone tell me the best way to
subtract StartTime from endTime and then subtract the LunchPeriod minutes to
obtain total hours worked in the day?

Any help appreciated.

regards

Pete

DateDiff("n", [StartTime], [EndTime]) - [LunchPeriod]
 
JOhn,

Thanks - worked fine!

Regards

Pete

John W. Vinson said:
Can anyone help?

I have two time fields (startTime and endTime) and a LunchPeriod field which
is an integer field holding minutes. Can anyone tell me the best way to
subtract StartTime from endTime and then subtract the LunchPeriod minutes to
obtain total hours worked in the day?

Any help appreciated.

regards

Pete

DateDiff("n", [StartTime], [EndTime]) - [LunchPeriod]
 
Back
Top