Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to Specify Date Format in Schema.ini File??

Status
Not open for further replies.

KellyStee

Technical User
Jul 30, 2001
106
US
I'm using a schema.ini file to import data into a database from a text file. I've figured out mostly everything except how to specify the formats of some fields.
I got most of my information here: and the website tells me it's POSSIBLE to specify the formats of my number and date fields, but it doesn't really say HOW to do this. Any help would be greatly appreciated!!
If you're looking at the website, the question I have deals with the last section "Specifying Data Type Formats and Conversions."

Kelly
 
Add DateTimeFormat to the Schema.ini file.

For example:

DateTimeFormat=ddmmyyyy
Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
ajdesalvo,
I'm still not able to get this to work.
My schema.ini file looks like this:
[Data.txt]
ColNameHeader=True
Format=Delimited(,)
MaxScanRows=0
CharacterSet=OEM
Col1="Employee ID" Float
Col3="Date Hired" DateTime(mmddyyyy)
DateTimeFormat=yyyy-mm-dd

I pass in the date in mmddyyyy format, like 01252003, and I want it formatted like yyyy-mm-dd. The import process seems to just disregard my DateTimeFormat line and the data in the field ALWAYS looks like mm/dd/yyyy no matter what I put on the DateTimeFormat line. Any suggestions?

Thanks!
Kelly
 
Add the line to the header information

[Data.txt]
ColNameHeader=True
Format=Delimited(,)
MaxScanRows=0
DateTimeFormat=ddmmyyyy
CharacterSet=OEM
Col1="Employee ID" Float
Col3="Date Hired" DateTime(mmddyyyy)
DateTimeFormat=yyyy-mm-dd


Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
ajdesalvo,
That didn't work either.
Now, my schema.ini file looks like this:
[Data.txt]
ColNameHeader=True
Format=Delimited(,)
MaxScanRows=0
DateTimeFormat=yyyy-mm-dd
CharacterSet=OEM
Col1="Employee ID" Float
Col3="Date Hired" DateTime(mmddyyyy)

Any other suggestions?

Thanks!
Kelly
 
Kelly,

I am sorry, I think I understand what your issue is now! [morning]

Do you mean when you look in the Table it appears like 01/01/1999?

If that is the case, then put the yyyy-mm-dd format in the table's Format property.

Anthony J. DeSalvo
President - ScottTech Software
"Integrating Technology with Business"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top