The user inputted… IN:4am OUT:8am
basically hours worked between midnight and 5:59am are paid at a different scale depending on position. So when a person works 4am – 8am 2 of those hours need to be paid at the special rate and 2 hours at regular.
The following iif statement in my query returns 24…when it should return 2
otadd: IIf([in] Between #12:00:00 AM# And #5:59:00 AM#,(DateDiff("h",[in] Between #5:59:00 AM# And #12:00:00 AM#,0)-DateDiff("h",[in] Between #6:00:00 AM# And #11:59:00 PM#,0)))
any suggestions on changing my iif statement?
basically hours worked between midnight and 5:59am are paid at a different scale depending on position. So when a person works 4am – 8am 2 of those hours need to be paid at the special rate and 2 hours at regular.
The following iif statement in my query returns 24…when it should return 2
otadd: IIf([in] Between #12:00:00 AM# And #5:59:00 AM#,(DateDiff("h",[in] Between #5:59:00 AM# And #12:00:00 AM#,0)-DateDiff("h",[in] Between #6:00:00 AM# And #11:59:00 PM#,0)))
any suggestions on changing my iif statement?