G
Guest
I'm trying to structure a query that utilizes a sub-query to select all
records from tblTransactionsALL that do not appear in
qryTransactions-MultipleSponsorsCorrectBankerAllocations for a given
transaction number. For example:
tblTransactionsALL has 3 records affilliated with transaction #1;
qryTransactions-MultipleSponsorsCorrectBankerAllocations has correctly
selected 2 of the 3 records associated with transaction #1. I need to figure
out which of the three was not selected from tblTransactionsALL.
I should note that the [Banker] field is what will distinquish the each of
the three records from the others for a given transaction.
This is the most recent in a long line of failed SQL attempts:
SELECT DISTINCT qryTransactionsAll.TransactionID,
qryTransactionsAll.CompanyName, qryTransactionsAll.ProjectName,
qryTransactionsAll.TransactionType, qryTransactionsAll.DealStatus,
qryTransactionsAll.DealSize, qryTransactionsAll.GrossRevenue,
qryTransactionsAll.Probability, qryTransactionsAll.PWR,
qryTransactionsAll.[BAS Role], qryTransactionsAll.DealID,
qryTransactionsAll.Banker, qryTransactionsAll.BankerAllocation,
qryTransactionsAll.BankerPWR, qryTransactionsAll.Bucket
FROM qryTransactionsAll
WHERE (((qryTransactionsAll.Banker) Not In (SELECT [Banker] FROM
[qryTransactions-MultipleSponsorsCorrectBankerAllocations] WHERE
(([qryTransactions-MultipleSponsorsCorrectBankerAllocations].[TransactionID]=[qryTransactionsAll].[TransactionID])))));
Any guidance will be appreciated. Thanks in advance.
records from tblTransactionsALL that do not appear in
qryTransactions-MultipleSponsorsCorrectBankerAllocations for a given
transaction number. For example:
tblTransactionsALL has 3 records affilliated with transaction #1;
qryTransactions-MultipleSponsorsCorrectBankerAllocations has correctly
selected 2 of the 3 records associated with transaction #1. I need to figure
out which of the three was not selected from tblTransactionsALL.
I should note that the [Banker] field is what will distinquish the each of
the three records from the others for a given transaction.
This is the most recent in a long line of failed SQL attempts:
SELECT DISTINCT qryTransactionsAll.TransactionID,
qryTransactionsAll.CompanyName, qryTransactionsAll.ProjectName,
qryTransactionsAll.TransactionType, qryTransactionsAll.DealStatus,
qryTransactionsAll.DealSize, qryTransactionsAll.GrossRevenue,
qryTransactionsAll.Probability, qryTransactionsAll.PWR,
qryTransactionsAll.[BAS Role], qryTransactionsAll.DealID,
qryTransactionsAll.Banker, qryTransactionsAll.BankerAllocation,
qryTransactionsAll.BankerPWR, qryTransactionsAll.Bucket
FROM qryTransactionsAll
WHERE (((qryTransactionsAll.Banker) Not In (SELECT [Banker] FROM
[qryTransactions-MultipleSponsorsCorrectBankerAllocations] WHERE
(([qryTransactions-MultipleSponsorsCorrectBankerAllocations].[TransactionID]=[qryTransactionsAll].[TransactionID])))));
Any guidance will be appreciated. Thanks in advance.