Hello everyone,
I've got a an issue with comparing dates in VB6 (sp4) and I would
greatly appreciate help that anyone has to offer on this subject...
:-)
I have two variables (start_DateTime and end_DateTime). Both contain
the following date information (this is what is printed in the
'immediate' window when I execute the following code)...
?start_DateTime = 15/09/04 02:00:00
?end_DateTime = 15/09/04 02:00:00
However, when I compare them both to see if there is a difference the
following statement returns true(it thinks end_DateTime >
start_DateTime) ...
If (start_DateTime < end_DateTime) Then
Do X
Do Y
Do Z
End If
However if I type the following...
?cdate("15/09/04 02:00:00") > cdate("15/09/04 02:00:00")
It returns...
False
Why is this happening? I do not understand; I can only assume that
there more information being held in the date data type than what I am
seeing.
Any help regarding this issue will be very much appreciated. Thank you
in advance.
SideNote:
I'm not sure if this will help, but if I type
?end_DateTime - start_DateTime
I get the following result...
7.2759576141834 3E-12
Regards,
Craig.
I've got a an issue with comparing dates in VB6 (sp4) and I would
greatly appreciate help that anyone has to offer on this subject...
:-)
I have two variables (start_DateTime and end_DateTime). Both contain
the following date information (this is what is printed in the
'immediate' window when I execute the following code)...
?start_DateTime = 15/09/04 02:00:00
?end_DateTime = 15/09/04 02:00:00
However, when I compare them both to see if there is a difference the
following statement returns true(it thinks end_DateTime >
start_DateTime) ...
If (start_DateTime < end_DateTime) Then
Do X
Do Y
Do Z
End If
However if I type the following...
?cdate("15/09/04 02:00:00") > cdate("15/09/04 02:00:00")
It returns...
False
Why is this happening? I do not understand; I can only assume that
there more information being held in the date data type than what I am
seeing.
Any help regarding this issue will be very much appreciated. Thank you
in advance.
SideNote:
I'm not sure if this will help, but if I type
?end_DateTime - start_DateTime
I get the following result...
7.2759576141834 3E-12
Regards,
Craig.
Comment