PC Review


Reply
Thread Tools Rate Thread

Changing Date format when Importing TXT file

 
 
=?Utf-8?B?U0lUQ0ZhblRO?=
Guest
Posts: n/a
 
      29th Mar 2007
I'm new to access and could use some help. I'm importing data into an access
table. the TXT file displays the date as 032807 however when it is imported
into access I want it to display in the table as 03/28/07. I have the Imput
Mask set in the table as "mm"/"dd"/"yy" however I get an error when I import
the data. Any help is appreciated, thank you.
 
Reply With Quote
 
 
 
 
Rick Brandt
Guest
Posts: n/a
 
      29th Mar 2007
SITCFanTN wrote:
> I'm new to access and could use some help. I'm importing data into
> an access table. the TXT file displays the date as 032807 however
> when it is imported into access I want it to display in the table as
> 03/28/07. I have the Imput Mask set in the table as "mm"/"dd"/"yy"
> however I get an error when I import the data. Any help is
> appreciated, thank you.


032807 is not a date and cannot be inserted into a date field directly no
matter what you do with formatting and input masks neither of which have a
thing to do with importing data.

You can either...

Link to the text file and then use an Append query based on the link to
insert the data into your destination table. In that append query you can
use...

Format(YourField,"00/00/00")

on that field and then it should be accepted in the date field.

OR

You can import first into a holding table where that field is defined as
text and then append from that table into the final one using the same
method outlined above.

--
Rick Brandt, Microsoft Access MVP
Email (as appropriate) to...
RBrandt at Hunter dot com


 
Reply With Quote
 
Pat Hartman \(MVP\)
Guest
Posts: n/a
 
      29th Mar 2007
The import wizard gives you the option of specifying the format of the
source date fields and mdy with no separators is one of the options. Press
the advanced button to see your choices. Then save the import spec. Once
saved, you can reference the spec in the TransferText Method/Action so you
only have to do this once.


"SITCFanTN" <(E-Mail Removed)> wrote in message
news:9314A0E3-FE5A-4C1D-A153-(E-Mail Removed)...
> I'm new to access and could use some help. I'm importing data into an
> access
> table. the TXT file displays the date as 032807 however when it is
> imported
> into access I want it to display in the table as 03/28/07. I have the
> Imput
> Mask set in the table as "mm"/"dd"/"yy" however I get an error when I
> import
> the data. Any help is appreciated, thank you.



 
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
changing format of fields when importing geert.van.ransbeeck@telenet.be Microsoft Access VBA Modules 3 13th Mar 2009 07:16 PM
Date format changing in csv file Deanne Microsoft Excel Misc 6 20th Mar 2008 02:36 AM
importing txt file and wrong date format... MACRO vs MANUAL a.lagolep@caramail.com Microsoft Excel Programming 2 4th Oct 2006 09:15 AM
How do I change the date format when importing a txt file? =?Utf-8?B?dnB1Y2tldHQ=?= Microsoft Excel Worksheet Functions 2 28th Nov 2005 10:53 PM
Importing Text without changing the Format to Scientific? Terry. Microsoft Access External Data 1 9th Feb 2004 10:24 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:23 PM.