
When is 5:00 AM not 5:00 AM? When it's 5:00 AM.
You gotta see this to believe it ...
When I add 15 minutes to 3:45 AM and compare that value with 4:00 AM, my
program says True. HOWEVER, When I add 15 minutes to 4:45 AM and compare
that value with 5:00 AM, my program says FALSE. This alternates with
various times ... go figure. Any suggestions would be appreciated
Here's the type of code I am using ...
Private Sub Command1_Click()
Dim tFromTime As Date
Dim tToTime As Date
tToTime = CDate(txtToTime) ' txtToTime is 05:00 AM
tFromTime = CDate(txtFromTime) ' txtToTime is 04:45 AM
tFromTime = DateAdd("n", 15, tFromTime)
' Both tToTime and tFromTime evaluate to 5:00:00 AM
' However, the comparison is False.
' If 04:00 AM and 03:45 AM were used then the comparison would be True.
If tFromTime = tToTime Then
Text1 = True
Else
Text1 = False
End If
End Sub
--
Mark Lewis
Corporate Consultants
"There are always alternatives"