Date not appearing properly in recordset

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!
 
D

Daryl S

Pendragon -

It looks like the control is formated as Time - change the format to the
Date format you want to see.
 
P

Pendragon

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.
 
P

Pendragon

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top