Subtracting Time Fields

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
 
I

Irene

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.
 
J

John W. Vinson

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]
 
P

PeteVTX

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]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top