If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Subtracting Time Fields
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 |
#2
|
|||
|
|||
Subtracting Time Fields
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. "PeteVTX" wrote: 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 |
#3
|
|||
|
|||
Subtracting Time Fields
On Thu, 29 May 2008 18:10:03 -0700, PeteVTX
wrote: 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 W. Vinson [MVP] |
#4
|
|||
|
|||
Subtracting Time Fields
JOhn,
Thanks - worked fine! Regards Pete "John W. Vinson" wrote: On Thu, 29 May 2008 18:10:03 -0700, PeteVTX wrote: 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 W. Vinson [MVP] |
Thread Tools | |
Display Modes | |
|
|