Long Question sorry: Trying to use CDATE to convert some dates

S

seakin

Hello all, First off I have no skills using access, but would greatly
appreciate any help.
I am trying to convert some times in a database using a query to a
normal date format they look like this in my Access table named
"users"

StartDate
37993.3314236111
37994.3501736111
37998.7087615741
37998.7412268519

EndDate
37993.331724537
37994.3504861111
37998.7090162037
37998.7414814815

I would like to somehow have them display a date like 1/10/2004 or
something similar. I am using a software called WebquizXP, an online
test taking software and it generates mdb files. I contacted their
support and got this response:

"They are in DOUBLE format. You can convert them to date with the CDATE
function in Access. Here's a sample MS Access query:

SELECT CDate(StartDate), * FROM User"


I have tried for a few hours now to get it working, but cannot seem to
get started in the right direction. If anyone can tell me the basic
steps to get started I would really appreciate it.
Thanks,
Sam
 
D

Duane Hookom

The values that you are seeing are actually how dates are stored internally.
For instance
cdate(37993.3314236111) = 1/7/2004 7:57:15 AM
You can just set the format of any text box displaying the value to General
Date.
Format(37993.3314236111,"general Date") = 1/7/2004 7:57:15 AM
 
J

John Vinson

"They are in DOUBLE format. You can convert them to date with the CDATE
function in Access. Here's a sample MS Access query:

SELECT CDate(StartDate), * FROM User"

Someone was sleepy...

Use DateValue() instead of CDate().
 
J

John Spencer (MVP)

John,
?????
I get an error when it try DateValue(225.1), but Cdate(255.1) returns 9/11/1900
2:24:00 AM .

This is in Access97, so maybe it differs in other versions.

John
 
J

John Vinson

John,
?????
I get an error when it try DateValue(225.1), but Cdate(255.1) returns 9/11/1900
2:24:00 AM .

This is in Access97, so maybe it differs in other versions.

John

someone WAS sleepy... ME!

Sorry about that!
 

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