I'm using the following SQL to create a Union Query that I will eventually append to a table (tblMaster). What I need to do though is to add a field to tblMaster which relates to the tables from which the original data is from.
Select * from Table1
UNION
Select * from Table2
UNION
Select * from Table3
The results of tblMaster should be like this
ID PosX PosY PosZ TableName
1 2 3 4 Table1
2 54 23 33 Table1
3 7 23 66 Table2
4 10 41 64 Table3
5 17 3 43 Table3
I've tried searching to find out how to include the table name in the query but have come up with nothing.
Can anyone point me in the right direction?
Select * from Table1
UNION
Select * from Table2
UNION
Select * from Table3
The results of tblMaster should be like this
ID PosX PosY PosZ TableName
1 2 3 4 Table1
2 54 23 33 Table1
3 7 23 66 Table2
4 10 41 64 Table3
5 17 3 43 Table3
I've tried searching to find out how to include the table name in the query but have come up with nothing.
Can anyone point me in the right direction?