Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 2 / March 2007

Tip: Looking for answers? Try searching our database.

Changing Date format when Importing TXT file

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
SITCFanTN - 29 Mar 2007 14:18 GMT
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.
Rick Brandt - 29 Mar 2007 14:35 GMT
> 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.

Signature

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

Pat Hartman (MVP) - 29 Mar 2007 15:16 GMT
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.

> I'm new to access and could use some help.  I'm importing data into an
> access
[quoted text clipped - 5 lines]
> import
> the data.  Any help is appreciated, thank you.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.