Hello Brian S.,
I pass it a date.....
#4/1/08#.. when I follow through the code all the way to the Return
x.Date,
it still has the #4/31/08# format, but in the textbox it includes
12:00
The VB DataType "Date" maps to the Framework "DateTime" DataType.
Therefore it will always contain a time component.
If you subtract the time in question from the date in question, you will
internally be storing 00:00:00 (midnight) on the date in question. depending
on localisation this might be displayed as "00:00:00" or "12:00:00" on the
given date.
This leads to various issues when comparing dates.
You might think is sensible to say...
-------------------------------------------------------------
If SomeDate = #20/Apr/2008# Then
End if
-------------------------------------------------------------
....when what you might really mean is...
-------------------------------------------------------------
If SomeDate >= #20/Apr/2008 00:00:00# andalso SomeDate < #21/Apr/2008 00:00:00
Then
Endif
-------------------------------------------------------------
....or perhaps if you prefer...
-------------------------------------------------------------
If SomeDate >= #20/Apr/2008 00:00:00# andalso SomeDate <= #20/Apr/2008 23:59:59
Then
Endif
-------------------------------------------------------------
I hope this helps.
--
Rory