B
bg17067
I am having problems with a comparative query. I have the following table:
[Tbl_Commission]
[Sales Rep]
[Manufacturer]
[Shipped Amount] (this is totaled)
[Shipped Date] (between start/end dates)
I have created two identical queries that run on different start/end dates
creating the comparative period. Qry1’s total is called [Current] and Qry2’s
total is [Prior]. I can show the figures I want either per manufacturer or
per Sales Rep but not by both.
Here is the SQL for one of the single queries:
SELECT Tbl_Commission.SalesRep, Tbl_Commission.Manufacturer, Sum
(Tbl_Commission.[Shipped Amount]) AS [SumOfShipped Amount], [SumOfShipped
Amount] AS [Current]
FROM Tbl_Commission
WHERE (((Tbl_Commission.ShippedDate) Between [Enter Current Start Date:] And
[Enter Current End Date:]))
GROUP BY Tbl_Commission.SalesRep, Tbl_Commission.Manufacturer;
I want the final query to group by Sales Rep & Manufacturer while showing the
Current and Prior totals from Qry’s 1 & 2. I can add the totals and compute
the math but it’s the grouping that I seem to have a problem with.
I appreciate any and all assistance,
Thanks,
Brian
[Tbl_Commission]
[Sales Rep]
[Manufacturer]
[Shipped Amount] (this is totaled)
[Shipped Date] (between start/end dates)
I have created two identical queries that run on different start/end dates
creating the comparative period. Qry1’s total is called [Current] and Qry2’s
total is [Prior]. I can show the figures I want either per manufacturer or
per Sales Rep but not by both.
Here is the SQL for one of the single queries:
SELECT Tbl_Commission.SalesRep, Tbl_Commission.Manufacturer, Sum
(Tbl_Commission.[Shipped Amount]) AS [SumOfShipped Amount], [SumOfShipped
Amount] AS [Current]
FROM Tbl_Commission
WHERE (((Tbl_Commission.ShippedDate) Between [Enter Current Start Date:] And
[Enter Current End Date:]))
GROUP BY Tbl_Commission.SalesRep, Tbl_Commission.Manufacturer;
I want the final query to group by Sales Rep & Manufacturer while showing the
Current and Prior totals from Qry’s 1 & 2. I can add the totals and compute
the math but it’s the grouping that I seem to have a problem with.
I appreciate any and all assistance,
Thanks,
Brian