I need to compare two times in 24-hour format.
The times are in string variables such as:
StartTime = "17:45"
EndTime = "19:00"
I need to check if EndTime is < StartTime.
How would I convert the string "17:45" and the string "19:00" to Long variables so I can compare which time is the earliest?
What I want to do is prevent the user from entering an EndTime that is earlier than the StartTime.
The EndTime can be zero but if it is set it cannot be earlier than the StartTime.
If EndTime > 0 And EndTime < StartTime Then
'stop right there
End If
I am using TimeDialog to set the StartTime and EndTime
Thanks
The times are in string variables such as:
StartTime = "17:45"
EndTime = "19:00"
I need to check if EndTime is < StartTime.
How would I convert the string "17:45" and the string "19:00" to Long variables so I can compare which time is the earliest?
What I want to do is prevent the user from entering an EndTime that is earlier than the StartTime.
The EndTime can be zero but if it is set it cannot be earlier than the StartTime.
If EndTime > 0 And EndTime < StartTime Then
'stop right there
End If
I am using TimeDialog to set the StartTime and EndTime
Thanks
Last edited: