Link to home
Create AccountLog in
Avatar of guzmandan
guzmandanFlag for United States of America

asked on

vbDate not equal to CDate

I have a field 'DateAdded' that is type DateTime in SQLServer 2005.  I have a textbox on a form that has 'DateTime inserted into it on load.

On exit I check to see if the DateAdded field has been changed by comparing the two

If RS.Fields("DateAdded") <> CDate(txtDateAdded.Text) Then

Watching the variables, both of them are:
7/22/2008 4:05:00 PM

I can't tell them apart.  Why does the above If statemnt evalute as true?
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
Avatar of guzmandan

ASKER

That worked!, Thanks.

Why did that work is another question I suppose.  Perhaps the DateDiff function forces the two values to be viewed as the same type.
Grading Comments:
That worked!, Thanks.

Why did that work is another question I suppose. Perhaps the DateDiff function forces the two values to be viewed as the same type.


I actually must think that either of the values also contains milliseconds, which were not displayed ...