guzmandan
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?
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
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
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 ...
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 ...
ASKER
Why did that work is another question I suppose. Perhaps the DateDiff function forces the two values to be viewed as the same type.