How to change yyyymmdd number field to a date field

M

mcin7535

How can I format a number field in a table that has the data formated
like yyyymmdd into a date field using a query?
 
S

Stefan Hoffmann

hi,
How can I format a number field in a table that has the data formated
like yyyymmdd into a date field using a query?
You can't format it. But you can build it:

DateSerial(Mid([Field], 1, 4), Mid([Field], 5, 2), Mid([Field], 7,2))



mfG
--> stefan <--
 
D

Douglas J. Steele

Stefan Hoffmann said:
hi,
How can I format a number field in a table that has the data formated
like yyyymmdd into a date field using a query?
You can't format it. But you can build it:

DateSerial(Mid([Field], 1, 4), Mid([Field], 5, 2), Mid([Field], 7,2))

Or CDate(Format([Field1], "####\-##\-##"))
 
M

mcin7535

How can I format a number field in a table that has the data formated
like yyyymmdd into a date field using a query?

Ok, the build option worked! Thanks for the help!
 

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