M
MrRJ
Hi,
I need your help. Here is my SQL as I understand that it may be helpful to
you to understand my problem. I have a table and mulitple queries in which I
am trying to create a summary report which lists Vendor and Types on the left
with Volume and Price listing across for each Period. It looks like the data
is a duplicate. How do I resolve this?
SELECT DISTINCTROW [Vendor / Types].[GP Vendor], [Vendor / Types].Types,
Sum([P 12 PET Rebate Calc].[SumOfAccpt Qty]) AS [SumOfSumOfAccpt Qty], Sum([P
12 PET Rebate Calc].[Rebate Rate]) AS [SumOfRebate Rate], Sum([P 11 PET
Rebate Calc].[SumOfAccpt Qty]) AS [SumOfSumOfAccpt Qty1], Sum([P 11 PET
Rebate Calc].[Rebate Rate]) AS [SumOfRebate Rate1], Sum([P 10 PET Rebate
Calc].[SumOfAccpt Qty]) AS [SumOfSumOfAccpt Qty2], Sum([P 10 PET Rebate
Calc].[Rebate Rate]) AS [SumOfRebate Rate2]
FROM (([Vendor / Types] LEFT JOIN [P 12 PET Rebate Calc] ON ([Vendor /
Types].[GP Vendor]=[P 12 PET Rebate Calc].[GP Vendor]) AND ([Vendor /
Types].Types=[P 12 PET Rebate Calc].Type)) LEFT JOIN [P 10 PET Rebate Calc]
ON ([Vendor / Types].[GP Vendor]=[P 10 PET Rebate Calc].[GP Vendor]) AND
([Vendor / Types].Types=[P 10 PET Rebate Calc].Type)) LEFT JOIN [P 11 PET
Rebate Calc] ON ([Vendor / Types].[GP Vendor]=[P 11 PET Rebate Calc].[GP
Vendor]) AND ([Vendor / Types].Types=[P 11 PET Rebate Calc].Type)
GROUP BY [Vendor / Types].[GP Vendor], [Vendor / Types].Types;
I need your help. Here is my SQL as I understand that it may be helpful to
you to understand my problem. I have a table and mulitple queries in which I
am trying to create a summary report which lists Vendor and Types on the left
with Volume and Price listing across for each Period. It looks like the data
is a duplicate. How do I resolve this?
SELECT DISTINCTROW [Vendor / Types].[GP Vendor], [Vendor / Types].Types,
Sum([P 12 PET Rebate Calc].[SumOfAccpt Qty]) AS [SumOfSumOfAccpt Qty], Sum([P
12 PET Rebate Calc].[Rebate Rate]) AS [SumOfRebate Rate], Sum([P 11 PET
Rebate Calc].[SumOfAccpt Qty]) AS [SumOfSumOfAccpt Qty1], Sum([P 11 PET
Rebate Calc].[Rebate Rate]) AS [SumOfRebate Rate1], Sum([P 10 PET Rebate
Calc].[SumOfAccpt Qty]) AS [SumOfSumOfAccpt Qty2], Sum([P 10 PET Rebate
Calc].[Rebate Rate]) AS [SumOfRebate Rate2]
FROM (([Vendor / Types] LEFT JOIN [P 12 PET Rebate Calc] ON ([Vendor /
Types].[GP Vendor]=[P 12 PET Rebate Calc].[GP Vendor]) AND ([Vendor /
Types].Types=[P 12 PET Rebate Calc].Type)) LEFT JOIN [P 10 PET Rebate Calc]
ON ([Vendor / Types].[GP Vendor]=[P 10 PET Rebate Calc].[GP Vendor]) AND
([Vendor / Types].Types=[P 10 PET Rebate Calc].Type)) LEFT JOIN [P 11 PET
Rebate Calc] ON ([Vendor / Types].[GP Vendor]=[P 11 PET Rebate Calc].[GP
Vendor]) AND ([Vendor / Types].Types=[P 11 PET Rebate Calc].Type)
GROUP BY [Vendor / Types].[GP Vendor], [Vendor / Types].Types;