How do you subtract hours in Access?

A

AccessIM

I have created a database that tracks the time an employee spends in
different job codes throughout the day. I have a query that looks at the
fields of StartDate, StartTime, EndDate and EndTime and calculates the number
of hours in each job code as well as total hours work each day.

The problem I'm having is this: I need to remove 30 minutes for lunch from
each employee that has over 6 total hours. I tried doing this with an "IIf"
statement but receive messages that the syntax is wrong. I would appreciate
any feedback on how to remove this 30 minutes. Thank you!
 
J

John Vinson

he problem I'm having is this: I need to remove 30 minutes for lunch from
each employee that has over 6 total hours. I tried doing this with an "IIf"
statement but receive messages that the syntax is wrong. I would appreciate
any feedback on how to remove this 30 minutes. Thank you!

The DateAdd() function will let you add or subtract minutes to a
date/time field, and the DateDiff() function will calculate the
difference in time between two date/time values (in any desired time
unit from seconds to years).

Since I have no idea how you're calculating these times I hesitate to
post suggested code.

John W. Vinson[MVP]
 

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