Importing a .csv file: date problem

SimonB1978

Registered User.
Local time
Today, 12:17
Joined
Jan 22, 2009
Messages
161
Hi,

I have a question regarding the importation of a text (.csv) file. I have a field that contains a date (as text) in this format: 15 SEP 09. The field in which this date is imported is of text format as well as in the import specification. However when the file is imported, the date is converted to 15-sept-09 which is not what I want.

Is there a way to prevent Access from doing this?

Thank you very much,

Simon B.
 
if its a csv, you can use a file spec to force the fields to whatever type you want

in the import wizard click advance button, and then save the filespec, for future use with docmd.transfertext
 
Hi,

It's exactly what I did. Everything is set up to text format, so I would expect it to import it the exact way it is in the file. However, it keeps on doing the conversion...

By the way I'm using Access 2002 SP3 in French if that matters....

Thank you,

Simon B.
 
I'm under the impression that Access uses the date format you choose as your Windows default.
 
Sorry but no. :)

My Windows default are:

Short date: 2009-01-22

Long date: 22 janvier 2009

But the questions that remains: Why is Access converting my "text" dates without me asking for it?

Simon B.
 
Format of that field in your import table definition?
 
Every field in the table itself is text as well as in the import specification. In the text file it is also in text (..., "15 SEP 09", ...) and I have " as the text delimiter in the import specs.

It seems to convert it according the the date format specified in the import spec window (YMD, - date delimiter).

When I import as text shouldn't it import it as it is in the file? Without doing any conversion?

Simon B.
 
I found a work around:

In the import spec. window, I specified a date format which cannot be associated with what I have, i.e. 15 SEP 09 cannot be converted with MYD format. That way my date format is kept.

I'd still like to know why it does the conversion....

Thanks for the help,

Simon B.
 
The fact that it's converting it like that would seem to indicate that it is properly interpreting it as a date value - that's a good thing.

Getting it to look the way you want should just be a matter of entering a formatting string (dd mmm yy) into the format property of the individual field in the table design.


Edited to add - your import spec may specify that the field is text, but if you're importing into an existing table structure where the field is a date/time, that's going to take precedence.
 
HI...

I want to know how can i delete import/export specifications in access 2003.

It is very urget. Please guide me.
 

Users who are viewing this thread

Back
Top Bottom