DateDiff question

M

Matthew Hinkle

Hello,
I'm trying to use a query in access to calculate the time worked in a day
(and week).
I was attempting to use the DateDiff function but it appears that you cannot
return both hours and minutes?
My example below shows how I have tried, but from what I have read it seems
that you must choose h for hours or n for minutes, however I need both values
for accurate timekeeping!
Example:
Total Time: DateDiff("h",[Time IN],[Time OUT])

After I have this total, I also need to add all hours worked for the week
and subtract them from 50:00 hours which is the minimum mandatory requirement
for my salary.
I started in Excel, but it has problems with negative time, so I thought a
database might be easier, but now I cannot get both hours and minutes...
 
M

Marshall Barton

Matthew said:
I'm trying to use a query in access to calculate the time worked in a day
(and week).
I was attempting to use the DateDiff function but it appears that you cannot
return both hours and minutes?
My example below shows how I have tried, but from what I have read it seems
that you must choose h for hours or n for minutes, however I need both values
for accurate timekeeping!
Example:
Total Time: DateDiff("h",[Time IN],[Time OUT])

After I have this total, I also need to add all hours worked for the week
and subtract them from 50:00 hours which is the minimum mandatory requirement
for my salary.
I started in Excel, but it has problems with negative time, so I thought a
database might be easier, but now I cannot get both hours and minutes...


Calculate the work durations and totals in minutes. For
display purposes, use the fact that there are 60 minuted in
an hour. For example, you van display the time in h:nn
style by using an expression like:
=[Total Time] \ 60 & Format([Total Time], ":nn")
 

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