Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subtract a half hour from a field If it's value is greater than 6 hrs 2

Status
Not open for further replies.

JSD

Technical User
Jan 18, 2002
189
US
Hello

I am working with a db that employees use to clock in and out of jobs for production/ efficiency tracking. I don't want them to have to take time to clock out for lunch. Is there a way to maybe create a calculated field that subtracts one half hour from another field called 'act hrs' if the value in 'act hrs' is greater than 6? Any ideas will be helpful as usual.

Thanks

Jeremy
 
Jeremy -

Are the values numeric or are they date/time?


Steve

 
SteveR77,

Hello. I have two date/time fields that I subtract in a calculated field to get the 'act hrs' value, which is numeric. I would need to subtract one half hour from the 'act hrs' value, If the value is greater than 6 hrs.

Thanks for your time

Jeremy
 
Not sure if I can help, but would something like this work?

Code:
IIf([act hrs]>6, [act hrs]-.5, [act hrs])
 
Jeremy,

sirace's IIF statement should do the trick for you. I just wanted to be sure if I posted a statement it would work for you.


Cheers,


Steve
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top