CSV text to Date Format

S

Stacey

I have a file which I will be uploading into Access on a regular basis. The
date field is formatted to text which I would like to format into a date
field upon importing into Access. I would also like to rearrange the date
into a regular format, it reads as such 082101 and I would like it to read
01/21/08. Any help is greatly appreciated. Thanks in advance!

Stacey.
 
J

John W. Vinson

I have a file which I will be uploading into Access on a regular basis. The
date field is formatted to text which I would like to format into a date
field upon importing into Access. I would also like to rearrange the date
into a regular format, it reads as such 082101 and I would like it to read
01/21/08. Any help is greatly appreciated. Thanks in advance!

Stacey.

That's a VERY strange date convention: two digit year, then two digit DAY,
then two digit month? Are you certain that yesterday wouldn't have been
080121?

If it is as you post, then try

DateSerial(Left([textdate], 2), Right([textdate], 2), Mid([textdate], 3, 2))

If it is as I propose, swap places between the Right() and Mid() function
calls.

John W. Vinson [MVP]
 
S

Stacey

John, it worked. Thanks!!

John W. Vinson said:
I have a file which I will be uploading into Access on a regular basis. The
date field is formatted to text which I would like to format into a date
field upon importing into Access. I would also like to rearrange the date
into a regular format, it reads as such 082101 and I would like it to read
01/21/08. Any help is greatly appreciated. Thanks in advance!

Stacey.

That's a VERY strange date convention: two digit year, then two digit DAY,
then two digit month? Are you certain that yesterday wouldn't have been
080121?

If it is as you post, then try

DateSerial(Left([textdate], 2), Right([textdate], 2), Mid([textdate], 3, 2))

If it is as I propose, swap places between the Right() and Mid() function
calls.

John W. Vinson [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