A
awalker
Hi All,
I have a make table Query that pulls records which include invoice numbers
(table name is PromoTableAgentIncentive). I have a query
(Promo_AgentIncentive_Exclude) that contains invoice numbers that are in the
PromoTableAgentIncentive but should be excluded from the final product. How
do I join these fields so that it excludes them? I have a feeling that it
can only be done in SQL. I do not know SQL very well (only from copying and
pasting and then modifying for current query) but am trying to learn. I've
copied the SQL for the query below but the join is not working. Any help
would be appreciated. Thank you.
SELECT PromoTableAgentIncentive.InvoiceDate,
PromoTableAgentIncentive.BookDate, PromoTableAgentIncentive.LocGroup,
PromoTableAgentIncentive.[Vendor Name], PromoTableAgentIncentive.[Agent
Name], PromoTableAgentIncentive.[Branch Name],
PromoTableAgentIncentive.PayID, PromoTableAgentIncentive.TravelType,
PromoTableAgentIncentive.Provider, PromoTableAgentIncentive.InvoiceNumber,
PromoTableAgentIncentive.RealUnits, PromoTableAgentIncentive.Data,
PromoTableAgentIncentive.Amount, PromoTableAgentIncentive.Year,
PromoTableAgentIncentive.PayID
FROM PromoTableAgentIncentive LEFT JOIN Promo_AgentIncentive_Exclude ON
PromoTableAgentIncentive.InvoiceNumber = Promo_AgentIncentive_Exclude.[Bad
Invoices]
GROUP BY PromoTableAgentIncentive.InvoiceDate,
PromoTableAgentIncentive.BookDate, PromoTableAgentIncentive.LocGroup,
PromoTableAgentIncentive.[Vendor Name], PromoTableAgentIncentive.[Agent
Name], PromoTableAgentIncentive.[Branch Name],
PromoTableAgentIncentive.PayID, PromoTableAgentIncentive.TravelType,
PromoTableAgentIncentive.Provider, PromoTableAgentIncentive.InvoiceNumber,
PromoTableAgentIncentive.RealUnits, PromoTableAgentIncentive.Data,
PromoTableAgentIncentive.Amount, PromoTableAgentIncentive.Year,
PromoTableAgentIncentive.PayID;
I have a make table Query that pulls records which include invoice numbers
(table name is PromoTableAgentIncentive). I have a query
(Promo_AgentIncentive_Exclude) that contains invoice numbers that are in the
PromoTableAgentIncentive but should be excluded from the final product. How
do I join these fields so that it excludes them? I have a feeling that it
can only be done in SQL. I do not know SQL very well (only from copying and
pasting and then modifying for current query) but am trying to learn. I've
copied the SQL for the query below but the join is not working. Any help
would be appreciated. Thank you.
SELECT PromoTableAgentIncentive.InvoiceDate,
PromoTableAgentIncentive.BookDate, PromoTableAgentIncentive.LocGroup,
PromoTableAgentIncentive.[Vendor Name], PromoTableAgentIncentive.[Agent
Name], PromoTableAgentIncentive.[Branch Name],
PromoTableAgentIncentive.PayID, PromoTableAgentIncentive.TravelType,
PromoTableAgentIncentive.Provider, PromoTableAgentIncentive.InvoiceNumber,
PromoTableAgentIncentive.RealUnits, PromoTableAgentIncentive.Data,
PromoTableAgentIncentive.Amount, PromoTableAgentIncentive.Year,
PromoTableAgentIncentive.PayID
FROM PromoTableAgentIncentive LEFT JOIN Promo_AgentIncentive_Exclude ON
PromoTableAgentIncentive.InvoiceNumber = Promo_AgentIncentive_Exclude.[Bad
Invoices]
GROUP BY PromoTableAgentIncentive.InvoiceDate,
PromoTableAgentIncentive.BookDate, PromoTableAgentIncentive.LocGroup,
PromoTableAgentIncentive.[Vendor Name], PromoTableAgentIncentive.[Agent
Name], PromoTableAgentIncentive.[Branch Name],
PromoTableAgentIncentive.PayID, PromoTableAgentIncentive.TravelType,
PromoTableAgentIncentive.Provider, PromoTableAgentIncentive.InvoiceNumber,
PromoTableAgentIncentive.RealUnits, PromoTableAgentIncentive.Data,
PromoTableAgentIncentive.Amount, PromoTableAgentIncentive.Year,
PromoTableAgentIncentive.PayID;