Subtracting time for lunch from hours worked

S

Shawn

I am using MS Access 2007. I have a start field and a stop field and a lunch
field.
Start field and stop field are set up as short time (military). Lunch is
set up a a number. Currently I am getting the minutes worked by using this
formula Minutes: DateDiff("n",[Begin],[End])

Then I take the lunch field and calculate it using this formula Expr1:
[Service]![Lunch]*60

Then to get the total minutes I use this formula Expr2: [Minutes]-[Expr1]

To get the total hours worked I use this formula Expr3: [Expr2]/60

Is there an easier way to do this?

Thanks
 
L

Lord Kelvan

I am using MS Access 2007.  I have a start field and a stop field and alunch
field.
Start field and stop field are set up as short time (military).  Lunch is
set up a a number.  Currently I am getting the minutes worked by using this
formula Minutes: DateDiff("n",[Begin],[End])

Then I take the lunch field and calculate it using this formula Expr1:
[Service]![Lunch]*60

Then to get the total minutes I use this formula Expr2: [Minutes]-[Expr1]

To get the total hours worked I use this formula Expr3: [Expr2]/60

Is there an easier way to do this?

Thanks

well if you want the values seperatally then no but if you only want
the end value stick it into oen line

hoursworked: (DateDiff("n",[Begin],[End])/60) - [Service]![Lunch]

since you want hours and not minutes it is eiser to divide the
datediff part by 60 rather than converting the lunch into minutes then
reconverting it back into hours

hope this helps

regards
kelvan
 

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