PC Review


Reply
Thread Tools Rate Thread

date format in schema.ini

 
 
Chutney via AccessMonster.com
Guest
Posts: n/a
 
      27th Apr 2006
I am importing a text file that has dates in the format 15MAR06. I have the
following in my schema.ini file but the dates are not imported into the date
field in the table:
DateTimeFormat = "ddmmmyy"
I have used this successfully to import other date formats (e.g. "dd/mm/yyyy")
.. Does anyone know if/how I can import this format? I am importing to a
staging table so I can import the date to a text field and then use a formula
to move the date to the master table. However, I am interested to know if it
is possible to get the date to import correctly in one move.

Thanks and regards.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...dules/200604/1
 
Reply With Quote
 
 
 
 
'69 Camaro
Guest
Posts: n/a
 
      28th Apr 2006
Hi, Chutney.

> Does anyone know if/how I can import this format?


Yes.

> However, I am interested to know if it
> is possible to get the date to import correctly in one move.


Format the date string so that Jet can recognize it as a date. The
following example works without a schema.ini file to guide the formatting,
so YMMV if you have a schema.ini file in the same directory:

INSERT INTO tblTextImport ( FName, LName, Address, DOB )
SELECT FName, LName, Address,
(MID(DOB, 1, 2) & " " & MID(DOB, 3, 3) & " " & MID(DOB,6, 2)) AS Temp
FROM [TEXT;DATABASE=C:\Test\].TextImport.txt;

.. . . where DOB in the table is a Date/Time data type, DOB in the text file
is a text field of format ddmmmyy, C:\Test\TextImport.txt is the path and
file name of the text file, and tblTextImport is the name of the table to
import the data into.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.


"Chutney via AccessMonster.com" <u14792@uwe> wrote in message
news:5f6bd8b403666@uwe...
>I am importing a text file that has dates in the format 15MAR06. I have the
> following in my schema.ini file but the dates are not imported into the
> date
> field in the table:
> DateTimeFormat = "ddmmmyy"
> I have used this successfully to import other date formats (e.g.
> "dd/mm/yyyy")
> . Does anyone know if/how I can import this format? I am importing to a
> staging table so I can import the date to a text field and then use a
> formula
> to move the date to the master table. However, I am interested to know if
> it
> is possible to get the date to import correctly in one move.
>
> Thanks and regards.
>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...dules/200604/1



 
Reply With Quote
 
Chutney via AccessMonster.com
Guest
Posts: n/a
 
      28th Apr 2006
Gunny,

Thanks very much for your suggestion. I have 49 columns including numerous
date fields in the import file so I was hoping to be able to add a single
format statement at the head of the existing schema.ini.

I have, however, attempted to use your suggestion in my code and am getting a
"missing operator" error for the concatenation. Any thoughts as to why?

Regards,
Rick

'69 Camaro wrote:
>Hi, Chutney.
>
>> Does anyone know if/how I can import this format?

>
>Yes.
>
>> However, I am interested to know if it
>> is possible to get the date to import correctly in one move.

>
>Format the date string so that Jet can recognize it as a date. The
>following example works without a schema.ini file to guide the formatting,
>so YMMV if you have a schema.ini file in the same directory:
>
>INSERT INTO tblTextImport ( FName, LName, Address, DOB )
>SELECT FName, LName, Address,
> (MID(DOB, 1, 2) & " " & MID(DOB, 3, 3) & " " & MID(DOB,6, 2)) AS Temp
>FROM [TEXT;DATABASE=C:\Test\].TextImport.txt;
>
>. . . where DOB in the table is a Date/Time data type, DOB in the text file
>is a text field of format ddmmmyy, C:\Test\TextImport.txt is the path and
>file name of the text file, and tblTextImport is the name of the table to
>import the data into.
>
>HTH.
>Gunny
>
>See http://www.QBuilt.com for all your database needs.
>See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
>http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
>info.
>
>>I am importing a text file that has dates in the format 15MAR06. I have the
>> following in my schema.ini file but the dates are not imported into the

>[quoted text clipped - 11 lines]
>>
>> Thanks and regards.


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...dules/200604/1
 
Reply With Quote
 
'69 Camaro
Guest
Posts: n/a
 
      29th Apr 2006
Hi, Chutney.

> I have 49 columns including numerous
> date fields in the import file so I was hoping to be able to add a single
> format statement at the head of the existing schema.ini.


Sorry. That won't work. The string formatting needs to be done in the
query.

> I have, however, attempted to use your suggestion in my code and am
> getting a
> "missing operator" error for the concatenation. Any thoughts as to why?


I pasted the SQL from a working query into the post, so I know it works.
Check to ensure that the ampersands, commas, spaces and parentheses are in
the right places in your query. If that doesn't help, then copy the
concatenation string from the post into your SQL View pane and replace DOB
with the name of one of your date fields, then test it. And watch out for
word wrap in the post.

HTH.
Gunny

See http://www.QBuilt.com for all your database needs.
See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
info.


"Chutney via AccessMonster.com" <u14792@uwe> wrote in message
news:5f77be3eafaf4@uwe...
> Gunny,
>
> Thanks very much for your suggestion. I have 49 columns including numerous
> date fields in the import file so I was hoping to be able to add a single
> format statement at the head of the existing schema.ini.
>
> I have, however, attempted to use your suggestion in my code and am
> getting a
> "missing operator" error for the concatenation. Any thoughts as to why?
>
> Regards,
> Rick
>
> '69 Camaro wrote:
>>Hi, Chutney.
>>
>>> Does anyone know if/how I can import this format?

>>
>>Yes.
>>
>>> However, I am interested to know if it
>>> is possible to get the date to import correctly in one move.

>>
>>Format the date string so that Jet can recognize it as a date. The
>>following example works without a schema.ini file to guide the formatting,
>>so YMMV if you have a schema.ini file in the same directory:
>>
>>INSERT INTO tblTextImport ( FName, LName, Address, DOB )
>>SELECT FName, LName, Address,
>> (MID(DOB, 1, 2) & " " & MID(DOB, 3, 3) & " " & MID(DOB,6, 2)) AS Temp
>>FROM [TEXT;DATABASE=C:\Test\].TextImport.txt;
>>
>>. . . where DOB in the table is a Date/Time data type, DOB in the text
>>file
>>is a text field of format ddmmmyy, C:\Test\TextImport.txt is the path and
>>file name of the text file, and tblTextImport is the name of the table to
>>import the data into.
>>
>>HTH.
>>Gunny
>>
>>See http://www.QBuilt.com for all your database needs.
>>See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials.
>>http://www.Access.QBuilt.com/html/ex...ributors2.html for contact
>>info.
>>
>>>I am importing a text file that has dates in the format 15MAR06. I have
>>>the
>>> following in my schema.ini file but the dates are not imported into the

>>[quoted text clipped - 11 lines]
>>>
>>> Thanks and regards.

>
> --
> Message posted via AccessMonster.com
> http://www.accessmonster.com/Uwe/For...dules/200604/1



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
converting general date format data into short date format savigliano Microsoft Access Form Coding 3 27th Nov 2006 04:37 AM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier Microsoft Excel Programming 0 22nd Sep 2004 03:26 PM
Schema.ini format and creation John Microsoft Access VBA Modules 3 7th Jun 2004 06:49 PM
Where is Schema.ini Format? John Microsoft Access VBA Modules 3 1st Jun 2004 03:32 AM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Microsoft Excel Programming 1 24th Nov 2003 11:33 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:16 PM.