Union Query

S

Scott

I've got two tables with lots of records (Daily Detail has 918 records and
General Charges has 260; all records in Daily Detail have an origin number
and all records in General Charges have a number - both fields are text). I
do a union query that I expect to bring in all records from each table, but
I'm getting back only 22 records. The Query is:

SELECT [origin number]
FROM [Daily Detail]

UNION select [number]
FROM [General Charges];

Can you tell me what I'm doing wrong? I've done simmilar Union Queries that
worked ok, so I know it can be done.
 
L

Lynn Trapp

UNION eliminates any duplicates. UNION ALL returns all records in both
tables. So try this:

SELECT [origin number]
FROM [Daily Detail]
UNION ALL
SELECT [number]
FROM [General Charges];
 

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