Trying to create a new Access table based on the results of 2 join queries (see below). Each query individually runs fine with no errors, but when I use UNION I receive an error message "An action query cannot be used as a row source". Can someone help? Thank you!
CODE:
SELECT file1.Lastname INTO Combined_Results
FROM TPX LEFT JOIN file1 ON TPX.[SECURITY ID] = file1.CUSIP
WHERE (((file1.cusip) Is Not Null));
union
SELECT file2.Lastname INTO Combined_Results
FROM SMX LEFT JOIN file2 ON SMX.[SECURITY ID] = file2.CUSIP
WHERE (((file2.cusip) Is Not Null));
CODE:
SELECT file1.Lastname INTO Combined_Results
FROM TPX LEFT JOIN file1 ON TPX.[SECURITY ID] = file1.CUSIP
WHERE (((file1.cusip) Is Not Null));
union
SELECT file2.Lastname INTO Combined_Results
FROM SMX LEFT JOIN file2 ON SMX.[SECURITY ID] = file2.CUSIP
WHERE (((file2.cusip) Is Not Null));
Last edited: