Union Query is deleting data

M

mr-tom

Hi,

I've got a union query:

SELECT qry_Sales_Quality_Total.[Adviser Alias],
qry_Sales_Quality_Total.TimeMonthKey, qry_Sales_Quality_Total.[CountOfAdviser
Alias]
FROM qry_Sales_Quality_Total;

UNION SELECT qry_Sales_QualityNew_Total.[Adviser Alias],
qry_Sales_QualityNew_Total.TimeMonthKey,
qry_Sales_QualityNew_Total.[CountOfAdviser Alias]
FROM qry_Sales_QualityNew_Total;


To give a simple example of what it does, there's two data sets (old and new):

Old:

Name Month Tests
Tom Jan 2
Tom Feb 2
Tom Mar 1

New:

Name Month Tests
Tom Mar 1
Tom Apr 2
Tom May 2

The union query should return:

Name Month Tests
Tom Jan 2
Tom Feb 2
Tom Mar 1
Tom Mar 1
Tom Apr 2
Tom May 2

Actually it is returning:

Name Month Tests
Tom Jan 2
Tom Feb 2
Tom Mar 1
Tom Apr 2
Tom May 2

(i.e. the duplicated March value is removed)

Obviously this is giving inaccurate results.

Any help very gratefully received.

Tom.
 
M

mr-tom

**************

SORRY - WORKED THIS OUT. APPARANTLY WHAT I NEEDED WAS "UNION ALL SELECT"

Thanks for reading any way.

Tom.

***************
 

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

Similar Threads


Top