If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
How can I run a query that searches for a reference number that may appear in two different columns? I want to pull all records for idenification numbers that can also show up in a secondary identification column.
SELECT *
FROM DBO.[NG 201107]
WHERE '2760561238' IN ([Column 0],[Column 26])
UNION ALL
SELECT *
FROM DBO.[NG 201108]
WHERE '2760561238' IN ([Column 0],[Column 26])
UNION ALL
...
SELECT *
FROM DBO.[NG 201112]
WHERE '2760561238' IN ([Column 0],[Column 26])