Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,570
- Office Version
- 365
- 2016
- Platform
- Windows
I have two times, curr_st and prev_et.
I need to figure out how many minutes there are between the two times.
If there is 30 minutes or more between the two times then do one thing (set svc_off = curr_tt - 30 minutes), otherwise, do another thing (set svc_off - curr_st)
This is my code:
When curr_st = 45117.75 (6:00pm), and prev_et = 45117.6145833 (2:45pm), there is clearly 30 minutes plus between the two times.
But my code triggers the "If tdiff < 0.5 then" statement, which is wrong.
I think the "If tdiff < 0.5 then" is wrong.
How do I correct this?
I need to figure out how many minutes there are between the two times.
If there is 30 minutes or more between the two times then do one thing (set svc_off = curr_tt - 30 minutes), otherwise, do another thing (set svc_off - curr_st)
This is my code:
VBA Code:
tdiff = curr_st - prev_et 'time difference
If tdiff < 0.5 Then
svc_off = curr_st
Else
svc_off = curr_st - TimeSerial(0, 30, 0)
End If
When curr_st = 45117.75 (6:00pm), and prev_et = 45117.6145833 (2:45pm), there is clearly 30 minutes plus between the two times.
But my code triggers the "If tdiff < 0.5 then" statement, which is wrong.
I think the "If tdiff < 0.5 then" is wrong.
How do I correct this?