# Thread: Subtracting Time Values (Access 2000)

1. ## Subtracting Time Values (Access 2000)

Could someone tell me how to adjust the formula below to include an IIF, so that IIF the hours worked are greater than or equal to 9, then subtract 1 hour? Also how to adjust it (proper syntax) so I don't have to be dividing by 60 to get the hours? I know the "n" is for minutes right? What do I use for hours? Whoops...edited here..."h", got that part.

Hours: DateDiff("n",[STime],[ETime])/60

Thanks

2. ## Re: Subtracting Time Values (Access 2000)

Hours: DateDiff("h",[STime],[ETime]) + (DateDiff("h",[STime],[ETime]) >= 9)

The expression DateDiff("h",[STime],[ETime]) >= 9 evaluates to either True = -1 or to False = 0. This is exactly what you want to add (add -1 is the same as subtract 1).

3. ## Re: Subtracting Time Values (Access 2000)

Beautiful! Thank you so much Hans...

A Big Salute <img src=/S/salute.gif border=0 alt=salute width=15 height=20>

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•