Ceejay64
Bass Playin' Biker Chick
- Local time
- Yesterday, 21:13
- Joined
- Oct 2, 2002
- Messages
- 74
I have a table in which we put clock in and clock out times for employees that tracks weekend coverage (plus all other relevent ee info). I have done a query that calculates the hours the ee is at work, which is functioning just fine, but in order to properly calculate "paid hours" I need to add .5 hrs to anyone who works a full 3rd shift as they only work 7.5 hrs, but get paid 8.
Initially, I wrote a single IIf statement to add the time for 3rd shifters, but this can only apply if they work a full shift, which not all do, so I need to specify that the calculation should only apply to anyone whose time calculates initially to the 7.5 hrs. But it doesn't work.
In the query, "Shift" is the shift, and "Hours" is the calculated amount of time. I created another field in the query called "hrs" and put in an expression. Here is what I have that isn't working right:
IIf([shift]="3",IIf([hours]="7.5",([hours]+0.5),[hours]))
It works fine for anyone on any other shift, but I get #error in all 3rd shift rows. When I remove the 2nd IIf, it adds .5 to all 3rd shift entries, which isn't always needed.
Any advice would be welcome! Thanks so much!
Initially, I wrote a single IIf statement to add the time for 3rd shifters, but this can only apply if they work a full shift, which not all do, so I need to specify that the calculation should only apply to anyone whose time calculates initially to the 7.5 hrs. But it doesn't work.
In the query, "Shift" is the shift, and "Hours" is the calculated amount of time. I created another field in the query called "hrs" and put in an expression. Here is what I have that isn't working right:
IIf([shift]="3",IIf([hours]="7.5",([hours]+0.5),[hours]))
It works fine for anyone on any other shift, but I get #error in all 3rd shift rows. When I remove the 2nd IIf, it adds .5 to all 3rd shift entries, which isn't always needed.
Any advice would be welcome! Thanks so much!