附加Access表名称 [英] Append an Access table name
问题描述
我有一个附加到主表的每日表...最后两列是附加日期和附加的表名。我有日期部分,但有没有办法拉出我附加的表的名称?即我将TrackedData11232013a附加到TrackedDataMaster中如何将TrackedData11232013a添加到TrackedDataMaster而不必每次都输入?
没有指定导入数据的选项csv文件的文件名。
你可以写这样的查询:
PARAMETERS [CSVFileName] CHAR ;
INSERT INTO DestinationTable(Field1,Field2,...,FieldN,FileName)
SELECT Field1,Field2,...,FieldN,[CSVFileName] AS FileName
FROM SourceTable IN [CSVFileName];
这将提示您(或任何其他用户)输入要导入的文件的名称。
注意:它应该是csv文件的完整路径和名称!
有关从文本文件导入数据的更多信息,请参阅: IN Command [ ^ ]
I have a daily table that I append to a master table...the last two column are the date the append is being done and the table name that is being appended. I have the date part but is there a way of pulling the name of the table that I am appending from? i.e. I'm appending TrackedData11232013a into TrackedDataMaster how do I add TrackedData11232013a into TrackedDataMaster without having to type it in each time?
There is no option to import data without specifying the file name of csv file.
You can write query like this:
PARAMETERS [CSVFileName] CHAR; INSERT INTO DestinationTable (Field1, Field2, ..., FieldN, FileName) SELECT Field1, Field2, ..., FieldN, [CSVFileName] AS FileName FROM SourceTable IN [CSVFileName];
which will prompt you (or any other user) for entering the name of file to import.
Note: it should be the full path and name of csv file!
For futher information about importing data from text file, please see: IN Command[^]
这篇关于附加Access表名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!