Have you thought through the logic???
Answer me this: What is the value of "ShiftLength" if the shift length is greater than 2???
I think "ShiftLength" will be zero/NULL........
I would hate to work for you for more that 2 hours a day.
You changed the code to this, but this calculates the shift length ONLY IF the length is less than 2 hrs!!!
Code:
If (ShiftEndDateTime - ShiftStartDateTime) * 24 < 2 Then 'this calculates the shift length ONLY IF the length is less than 2 hrs!!!
ShiftLength = (ShiftEndDateTime - ShiftStartDateTime) * 24
End If
What about if the shift length is Greater Than 2 hrs??
It would be better to comment out the statements you don't want to use:
Code:
' If (ShiftEndDateTime - ShiftStartDateTime) * 24 < 2 Then
' ShiftLength = 2
' Else
ShiftLength = (ShiftEndDateTime - ShiftStartDateTime) * 24 'this calculates the shift length
' End If
I'm just sayin............