Convert date serial from text to date value

G

Guest

Field is text, value is "39254".

I want to sort and format as short date.

Cdate and Cvdate seems to be looking for short date format in text i.e
"01/01/01"

I tried to just redefine the field from text to date, but that deletes
records.

How to I convert to date serial from text that looks like date serial, not
date.?

Thanks
 
D

Douglas J. Steele

Add a new Date field and do an Update to populate it:

UPDATE MyTable
SET DateField = CLng([TextDateField])
 
G

Guest

Thanks Doug,

Should this not work in a Query, as well?

DateField: =Clng(TextDateField)



Douglas J. Steele said:
Add a new Date field and do an Update to populate it:

UPDATE MyTable
SET DateField = CLng([TextDateField])

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Lee Hunter said:
Field is text, value is "39254".

I want to sort and format as short date.

Cdate and Cvdate seems to be looking for short date format in text i.e
"01/01/01"

I tried to just redefine the field from text to date, but that deletes
records.

How to I convert to date serial from text that looks like date serial, not
date.?

Thanks
 
D

Douglas J. Steele

Yes, but I thought you wanted a permanent solution.

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Lee Hunter said:
Thanks Doug,

Should this not work in a Query, as well?

DateField: =Clng(TextDateField)



Douglas J. Steele said:
Add a new Date field and do an Update to populate it:

UPDATE MyTable
SET DateField = CLng([TextDateField])

--
Doug Steele, Microsoft Access MVP

(no e-mails, please!)


Lee Hunter said:
Field is text, value is "39254".

I want to sort and format as short date.

Cdate and Cvdate seems to be looking for short date format in text i.e
"01/01/01"

I tried to just redefine the field from text to date, but that deletes
records.

How to I convert to date serial from text that looks like date serial,
not
date.?

Thanks
 

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

Similar Threads


Top