If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Importing Text Problem
Hi,
I have a csv file with the following content 2009-07-13,34195,1,CI000139,3,A When I import it into ms accesss with: 'Import Text File file_name = "M:\Reorder\toolcrib\toolcrib.csv" DoCmd.TransferText acImportDelim, "", "Temp", file_name, False, "" the first column (2009-07-13) is imported as a date and change it to '7/13/2009' I dont want that to happen, I need this column to be imported as text and as '2009-07-13' Any ideas? Thank you all!!!!! Bre-x |
#2
|
|||
|
|||
Importing Text Problem
Set up and save an import specification that defines the field types.
You can set up an import specification by doing a manual import ==File: Get External Data: Import ==Choose the text file ==Follow the on-screen instructnions ==Set up the field specifications ==Click the advanced button ==When you have the specifications set up click the Save As... button to save the specification Now when you use DoCmd.TransferText use the name of the import specification as the second argument. John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County Bre-x wrote: Hi, I have a csv file with the following content 2009-07-13,34195,1,CI000139,3,A When I import it into ms accesss with: 'Import Text File file_name = "M:\Reorder\toolcrib\toolcrib.csv" DoCmd.TransferText acImportDelim, "", "Temp", file_name, False, "" the first column (2009-07-13) is imported as a date and change it to '7/13/2009' I dont want that to happen, I need this column to be imported as text and as '2009-07-13' Any ideas? Thank you all!!!!! Bre-x |
#3
|
|||
|
|||
Importing Text Problem
John Spencer thank you for answering my post!!
But i decide to take another way. Public Function mydate(the_date As String) As String mydate = Format(the_date, "YYYY") & "-" & Format(the_date, "MM") & "-" & Format(the_date, "DD") End Function Thank you again!!! "Bre-x" wrote in message ... Hi, I have a csv file with the following content 2009-07-13,34195,1,CI000139,3,A When I import it into ms accesss with: 'Import Text File file_name = "M:\Reorder\toolcrib\toolcrib.csv" DoCmd.TransferText acImportDelim, "", "Temp", file_name, False, "" the first column (2009-07-13) is imported as a date and change it to '7/13/2009' I dont want that to happen, I need this column to be imported as text and as '2009-07-13' Any ideas? Thank you all!!!!! Bre-x |
Thread Tools | |
Display Modes | |
|
|