Click here to Skip to main content
15,891,828 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have daily files that need to be appended to the same Access table. I need to add the file name and date/time to the end of each record of each daily file I import(...so we can distinguish the records as to when and which file they came from).

Question: How do I add the File Name and the Import Date/Time to the end of each record when I import? Note: I will be append the daily files to the same table.
Posted
Comments
RedDk 22-Nov-13 16:48pm    
As I recall, this is a fuzzy concept in Office. To each his own when it comes to "records" so for the sake of argument I'll call this "data". As .txt text it's not so suitable for import into Access. So I used Excel as the organizer. Once in Excel I can decide what's-what. But from Excel getting the data into Access is VERY easy. So there's the roadmap I used. Back in the day.
Runner55Code 23-Nov-13 10:52am    
Thank you for your response but it doesn't really answer the question. I need to know how to add the Filename and DateTime on each import.

1 solution

I would guess there is no clever way to do this. So you do the following

First of course you need the columns on the table itself. Each record needs a name and timestamp. Each is nullable.

The import will import the new records.

After the import do an update on all records where the name and timestamp are null an you use the data from the file. The fact that columns are null allow you to find the correct records.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900