Importing Date string and changing form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am importing a CSV file that has a date field in the following format:
20050625. I need to convert this string to 06252005. What is the best way to
do this when I import the file?

Thanks
 
Mid([YourString], 5, 2) & Right([YourString, 2) & Left([YourString], 4)
 
I am importing a CSV file that has a date field in the following format:
20050625. I need to convert this string to 06252005. What is the best way to
do this when I import the file?

Thanks

Two possible answers:

If you want to import to a Text field containing a String (which you,
but not Access, may interpret as a date) use

Mid([CSVDate], 5) & Left([CSVDate, 4)

If you prefer, you can import it to a Date/Time field which can be
displayed with a mmddyyyy format (or any other format you wish) with

DateSerial(Left([CSVDate], 4), Mid([CSVDate], 5, 2), Right([CSVDate],
2))

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

Back
Top