Union Query to list duplicates

M

MissBanjo

I've created a union query in multiple tables (73 to be exact) to create a
list of duplicates of a certain field. I had to create 2 union queries then
union them together because I couldn't go over a certain number of tables, no
big deal. My problem is the query doesn't show the tables anymore. Didn't
it used to have a + to the left of the rows that you could click on to see
what tables were involved with that value? Is there a way to show this in a
union query?
 
K

KARL DEWEY

the query doesn't show the tables anymore.
Explain a little more. What view are you not seeing the tables that you
think you should?
 
J

John W. Vinson

I've created a union query in multiple tables (73 to be exact) to create a
list of duplicates of a certain field. I had to create 2 union queries then
union them together because I couldn't go over a certain number of tables, no
big deal. My problem is the query doesn't show the tables anymore. Didn't
it used to have a + to the left of the rows that you could click on to see
what tables were involved with that value? Is there a way to show this in a
union query?

The + had to do with subdatasheets, and never to my knowledge worked as you
describe. What I'll do in a massive UNION query such as you describe is
explicitly include the tablename in the UNION query:

SELECT Table1.Thisfield, Table1.Thatfield, "Table1" AS Tablename
FROM Table1
WHERE Thisfield IS NOT NULL
UNION
SELECT Table2.Thisfield, Table2.Thatfield, "Table2"
FROM Table2
WHERE thisfield IS NOT NULL

....

This gives you a new field Tablename in the UNION.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top