The tables are joined like a Union query. Timâs right, they have to have the same fields, ad they need to be matched.
Create the top level query and add the display fields.
Create a subquery, Type is Except.
Add the display fields, use the field at the bottom of the screen. it tells you which you need to match next.
You will notice that you cannot add the subquery to join the table in top level query.
select
[Part].[PartNum] as [Part_PartNum],
[Part].[PartDescription] as [Part_PartDescription],
[Part].[ClassID] as [Part_ClassID],
[Part].[ProdCode] as [Part_ProdCode],
[Part].[IUM] as [Part_IUM],
[Part].[PUM] as [Part_PUM],
[Part].[SalesUM] as [Part_SalesUM],
[Part].[ISOrigCountry] as [Part_ISOrigCountry],
[Part].[HTS] as [Part_HTS],
[Part].[SchedBcode] as [Part_SchedBcode],
[Part].[PurchasingFactor] as [Part_PurchasingFactor],
[Part].[NAFTAOrigCountry] as [Part_NAFTAOrigCountry],
[Part].[NAFTAProd] as [Part_NAFTAProd],
[Part].[NAFTAPref] as [Part_NAFTAPref],
[Part].[UOMClassID] as [Part_UOMClassID],
[Part].[PricingFactor] as [Part_PricingFactor],
[Part].[PricingUOM] as [Part_PricingUOM]
from Erp.Part as Part
where (Part.Company = â100â and Part.InActive = FALSE)
except
select
[Part1].[PartNum] as [Part1_PartNum],
[Part1].[PartDescription] as [Part1_PartDescription],
[Part1].[ClassID] as [Part1_ClassID],
[Part1].[ProdCode] as [Part1_ProdCode],
[Part1].[IUM] as [Part1_IUM],
[Part1].[PUM] as [Part1_PUM],
[Part1].[SalesUM] as [Part1_SalesUM],
[Part1].[ISOrigCountry] as [Part1_ISOrigCountry],
[Part1].[HTS] as [Part1_HTS],
[Part1].[SchedBcode] as [Part1_SchedBcode],
[Part1].[PurchasingFactor] as [Part1_PurchasingFactor],
[Part1].[NAFTAOrigCountry] as [Part1_NAFTAOrigCountry],
[Part1].[NAFTAProd] as [Part1_NAFTAProd],
[Part1].[NAFTAPref] as [Part1_NAFTAPref],
[Part1].[UOMClassID] as [Part1_UOMClassID],
[Part1].[PricingFactor] as [Part1_PricingFactor],
[Part1].[PricingUOM] as [Part1_PricingUOM]
from Erp.Part as Part1
where (Part1.Company = @ExternalCompany)