Problem importing dates

G

Guest

Hi,
I have a text file with fields delimited by |
When i do a straight import and look at the table data types some are text
and some are date/time (with no format) the dates that come look as they do
in the text file 2005/10/30.

What I want to do is import the data to a table with the data type for dates
as date/time formatted as short date.( I can't alter the text file at all) If
I set up specifications as date/time I am getting type conversion errors and
no date importing at all: Does anyone know how I can deal with these dates to
get them to import and in the format of dd/mm/yyyy instead of yyyy/mm/dd

Any help greatly appreciated
 
J

Joe Fallon

The most common solution is to import the data to a temp table.
Do this so that you do not lose any of the data!
e.g. set all fields to Text.

Then, once the data is in Access, write a query to move the data out of the
temp table to the real table.
Use Date functions to transform the bad dates to the ones you want.
 
G

Guest

Thanks Joe. That's what i thought I might get, was just hopeful there may
have been another way.
 
J

Joe Fallon

Not using the wizard.
You can use code if you want though.
Then you can "transform" as you read.

As far as using a temp table, in my opinion:
There is way too much emphasis on doing things with "1 line of code".
Nothing wrong with taking 2 steps to get the right answer.
 

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