ASP Form Date Field returns as time

T

Tom T.

I have an access database setup with the field set as Date/Time. When I
store or update the data through the ASP Forms it returns on the form as a
time format (HH:MM:SS AM) even through we stored MM/DD/YYYY. I have tried
changing the database field to Short and Long dates, Tried adding an input
mask, Recreating the fields both manually and using the wizard. When I view
the caputed data from the ASP page it shows as MM/DD/YYYY until you click on
the field within the table and it changes to a time format. If I manually
enter the data into Access it will display correctly with the ASP Form but
again changes if you update the record. The data entry field is a basic text
box in frontpage. I have the SQL Statement to update the field which is
displayed as CertDate=::CertDate:: with no quotes. Is there another way it
should be written? What am I missing?
 
D

David Berry

Is it the value in the table that's not in a date format or is it just the
value on the page (after you retrieve it from the table) that's not in a
date format?

If it's on the screen do:

FormatDateTime(rs("FieldName"), vbshortdate)


If it's the SQL Statement use # symbols to indicate it's a date. Ex:

"SELECT * FROM Table WHERE (CertDate= #::CertDate::#)"

Or you can use this in your SQL Statement

SELECT format(CertDate,'mm/dd/yyyy')
 
T

Tom T.

I tried these and still does not work. For example, I enter in 12/30/1999 in
the form and it sends it to the db. When I open access and look at the data
in the table it shows as 12/30/1899. When I click in the field to edit the
data in the access table it changes to 12:00:17 AM. Like I mentioned I have
tried to change the field within access to a long date, short date, general
date, I have even entered the subnet mask.

Any Advice...?
 

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