Date not appearing properly in recordset

  • Thread starter Thread starter Pendragon
  • Start date Start date
P

Pendragon

Access03

Dim StartDate as Date

I have a recordset which grabs a date-formatted field. StartDate is set to
this recordset field. In the immediate window, rsDetail("RevDate") properly
shows 1/31/2010; however, StartDate shows 12:00:00 AM.

Can somebody explain why this would be the case?

Thanks!
 
Pendragon -

It looks like the control is formated as Time - change the format to the
Date format you want to see.
 
The field in the table is set as Date/Time and the format is Short Date with
an Input Mask of 99/99/9999;; There are no time displays for any records in
this field.
 
Problem resolved. I ran a couple tests in passing the recordset date into a
string and then using CDate to reset back into a Date variable. This works.

StartDate = CDate(rsDetail("RevDate"))

I'd still like to know why data set as a date being passed to a variable set
as a date would not properly run as a date and instead simply have a value of
midnight.
 
Back
Top