Union Query is deleting data

  • Thread starter Thread starter mr-tom
  • Start date Start date
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.
 
**************

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

Thanks for reading any way.

Tom.

***************
 
Back
Top