Prevent Duplicates from Union Query

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a simple Union Query, but it returns duplicates from my 2 tables. I am
using just the Union Select not Union All Select. Is there an easy way to
prevent the duplicates?

SQL:

Select Customerreffullname as customer, RequestDate as
RequestDateorNumberofDayssincelastpickup, RequestType
from qrypickuprequestMMCO

UNION select Customer, Dayssincelastpickup as
RequestDateorNumberofDayssincelastpickup, RequestType
from qryMutualInvoiceOrderLineLastPickupPastDeadline;
 
A UNION query can not return duplicate records. Something in the record MUST
be different for them to be returned. So you need to define what you consider
a duplicate. Is it one field or a combination of more than one field? Which
fields?
 
Back
Top