Change text format to date format

J

JLDLS

I have an existing database in which the dates in a table have been entered
as text "01/01/2009", but I would like to run queries based upon date. Is
there a way to change the format of this column to date without losing the
text (converting the text to a date format). I have over 3000 records in the
database. Thanks.
 
J

John W. Vinson

I have an existing database in which the dates in a table have been entered
as text "01/01/2009", but I would like to run queries based upon date. Is
there a way to change the format of this column to date without losing the
text (converting the text to a date format). I have over 3000 records in the
database. Thanks.

Sure: CDate([textdate]) will convert it to a date/time field in accord with
the user's computer's Regional date/time format; i.e. if the regional date
setting is mm/dd/yyyy, American style, then a text string "08/10/2009" will be
seen as August 10; if the regional setting is the British dd/mm/yyyy the same
text string will be seen as October 8.
 
L

Larry Linson

JLDLS said:
I have an existing database in which the dates
in a table have been entered as text "01/01/2009",
but I would like to run queries based upon date.
Is there a way to change the format of this column
to date without losing the text (converting the text
to a date format). I have over 3000 records in the
database. Thanks.

Add a date field, then use an update query to populate it with
CVDate([strDate]) where strDate is the field with the date as a text string.

Larry Linson
Microsoft Office Access MVP
 

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