E
Esaw
I have created the following UNION query to get all of the contracts and all
of the royalties together, even if either do not have a contract number. This
UNION query is not showing the Royalties that do not have a Contract Number
assigned to them but it is showing the Contracts that do not have a Contract
Number. I've tried to add WHERE [Royalties
Query].Royalties.ContractNumber.Value IS NULL and that does not change the
results. Does anyone have any suggestions?
SELECT ContractsQuery.ClientName, ContractsQuery.ContractNumber,
ContractsQuery.ArtistName, ContractsQuery.StyleNumber,
ContractsQuery.StyleDescription, ContractsQuery.ContractStart,
ContractsQuery.ContractEnd, ContractsQuery.Product, [Royalties
Query].RoyaltyAmount, [Royalties Query].[TT%], [Royalties Query].DatePaid,
[Royalties Query].Notes, [RoyaltyAmount]*[TT%] AS TTSCommission,
[RoyaltyAmount]-[TTSCommission] AS ArtistCommission
FROM ContractsQuery LEFT JOIN [Royalties Query] ON
ContractsQuery.ContractNumber = [Royalties
Query].Royalties.ContractNumber.Value;
UNION SELECT ContractsQuery.ClientName, ContractsQuery.ContractNumber,
ContractsQuery.ArtistName, ContractsQuery.StyleNumber,
ContractsQuery.StyleDescription, ContractsQuery.ContractStart,
ContractsQuery.ContractEnd, ContractsQuery.Product, [Royalties
Query].RoyaltyAmount, [Royalties Query].[TT%], [Royalties Query].DatePaid,
[Royalties Query].Notes, [RoyaltyAmount]*[TT%] AS TTSCommission,
[RoyaltyAmount]-[TTSCommission] AS ArtistCommission
FROM ContractsQuery RIGHT JOIN [Royalties Query] ON
ContractsQuery.ContractNumber = [Royalties
Query].Royalties.ContractNumber.Value;
of the royalties together, even if either do not have a contract number. This
UNION query is not showing the Royalties that do not have a Contract Number
assigned to them but it is showing the Contracts that do not have a Contract
Number. I've tried to add WHERE [Royalties
Query].Royalties.ContractNumber.Value IS NULL and that does not change the
results. Does anyone have any suggestions?
SELECT ContractsQuery.ClientName, ContractsQuery.ContractNumber,
ContractsQuery.ArtistName, ContractsQuery.StyleNumber,
ContractsQuery.StyleDescription, ContractsQuery.ContractStart,
ContractsQuery.ContractEnd, ContractsQuery.Product, [Royalties
Query].RoyaltyAmount, [Royalties Query].[TT%], [Royalties Query].DatePaid,
[Royalties Query].Notes, [RoyaltyAmount]*[TT%] AS TTSCommission,
[RoyaltyAmount]-[TTSCommission] AS ArtistCommission
FROM ContractsQuery LEFT JOIN [Royalties Query] ON
ContractsQuery.ContractNumber = [Royalties
Query].Royalties.ContractNumber.Value;
UNION SELECT ContractsQuery.ClientName, ContractsQuery.ContractNumber,
ContractsQuery.ArtistName, ContractsQuery.StyleNumber,
ContractsQuery.StyleDescription, ContractsQuery.ContractStart,
ContractsQuery.ContractEnd, ContractsQuery.Product, [Royalties
Query].RoyaltyAmount, [Royalties Query].[TT%], [Royalties Query].DatePaid,
[Royalties Query].Notes, [RoyaltyAmount]*[TT%] AS TTSCommission,
[RoyaltyAmount]-[TTSCommission] AS ArtistCommission
FROM ContractsQuery RIGHT JOIN [Royalties Query] ON
ContractsQuery.ContractNumber = [Royalties
Query].Royalties.ContractNumber.Value;