View Full Version : Union Query Ignors Duplicates


wizcow
12-30-2003, 06:08 PM
Hi

I have a union query that is putting together info from three other querys.

The problem I have is that it will ignor duplicate values.

SELECT[InvoiceDate],[PaymentType],[Retail]
FROM[QryCOPartUnion]

UNION SELECT[InvoiceDate], [PaymentType],[PVisit]
FROM[QryCOPracUnion]

UNION SELECT[InvoiceDate], [PaymentType],[TVisit]
FROM[QryCOTherUnion];

For instance if the [QryCOPartUnion] PaymentType = Cash, Retail = $10.00
and [QryCOPracUnion] PaymentType = Cash, PVisit = $10.00
only one $10.00 value will be in the record set.
Not both, wich I would like.

Is there a way to get both values to show?

Tom

Jon K
12-30-2003, 07:20 PM
Put the word ALL after the word UNION i.e.

UNION ALL .....

wizcow
12-30-2003, 08:17 PM
Bravo!

Jon you fixed it!

Thanks
Tom