UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Importing Dates From Text File    
 
   
Rookieoftheyear2...
post Apr 2 2012, 09:05 PM
Post #1

New Member
Posts: 14



Hello UA, new user here. Thanks in advance for your input. Working with Access 2007.

I'm working on a database that will be importing approximately 200,000 entries per day from a text file. One of the columns includes a date and time stamp formatting YYYYMMDD 12:00. For the purpose of the database I don't need the time information, I just need the date to be imported, I really don't need the time information so if there was a way to exclude that that would be great. When I did try import that file I went under the advanced tab to change the information type from Text to Date/Time and it gave me an error message which left that column blank in my table.

Basically 2 questions:

Is it possible to remove the time entry in my data before importing it into access? (maybe with excel)

If not, who do I import from my text file and display just the date information?


Formating looks like this delimited by tabs: YYYYMMDD 12:00 example: 20120402 09:05

I really appreciate the help.
Go to the top of the page
 
+
RJD
post Apr 2 2012, 09:46 PM
Post #2

UtterAccess Ruler
Posts: 1,405
From: Gulf South USA



(IMG:style_emoticons/default/welcome2UA.gif)

When I am faced with a situation like this I usually import the text file into a transition table, then format it over to my "real" table. This can be automated (VBA) with 1) a query to clear the transition table, 2) import the text file into the transition table, 3) transfer the transition table records to the main table with an append query. The DateTimeStamp text field itself can be transferred to a date field in the main table with something like this in the query:

CODE
DateSerial(Left([ImportedDateTime],4),Mid([ImportedDateTime],5,2),Mid([ImportedDateTime],7,2)) AS DateStamp


...using your correct field names, of course.

HTH
Joe

Go to the top of the page
 
+
Gustav
post Apr 3 2012, 05:08 AM
Post #3

UtterAccess VIP
Posts: 1,821



Or you can use this expression which will import a date/time value with the date only:

DateValue(Format(TimeStampString, "!@@@@/@@/@@"))

/gustav
Go to the top of the page
 
+
Rookieoftheyear2...
post Apr 3 2012, 01:54 PM
Post #4

New Member
Posts: 14



Thank you both very much!
Go to the top of the page
 
+
RJD
post Apr 3 2012, 01:59 PM
Post #5

UtterAccess Ruler
Posts: 1,405
From: Gulf South USA



(IMG:style_emoticons/default/yw.gif)
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 20th May 2013 - 01:23 PM