I know that this is probably a very basic question but I can't seem to get it right.
I want to test data against a time 12.00 midday, sometimes it works, sometimes it doesn't. I think that it is not seeing the AM/PM. Can anyone point me in the right direction.
if my start time is say 9.00AM it skips to the else statement
Here is my code
Dim x As Date
Dim y As Date
If Me.StartTime < "12.01PM" Then
x = Me.StartDate - 1
Else
x = Me.StartDate
End If
If Me.EndTime >= "12.01PM" Then
y = Me.EndDate
Else
y = Me.EndDate - 1
End If
Thanks
I want to test data against a time 12.00 midday, sometimes it works, sometimes it doesn't. I think that it is not seeing the AM/PM. Can anyone point me in the right direction.
if my start time is say 9.00AM it skips to the else statement
Here is my code
Dim x As Date
Dim y As Date
If Me.StartTime < "12.01PM" Then
x = Me.StartDate - 1
Else
x = Me.StartDate
End If
If Me.EndTime >= "12.01PM" Then
y = Me.EndDate
Else
y = Me.EndDate - 1
End If
Thanks