G
Guest
Hello,
I have the following crosstab query, and am trying to make a few changes.
1) In the PIVOT line, I want to define the quarters as my fiscal quarters
(ie: 1/2/05 - 4-2-05 for Q1) rather than the standard quarters access uses
(1/1/05-3/3105).
2) I would like to make the transform line variable based on a form
parameter. IE: enter "Amount" on the form you get
TRANSFORM Sum(Sales.Amount) AS SumOfAmount.
Enter "Volume" on the form and you get
TRANSFORM Sum(Sales.Volume) AS SumOfVolume
Any help would be greatly appreciated! (SQL below) Thanks.
***************************
TRANSFORM Sum(Sales.Amount) AS SumOfAmount
SELECT Customers.CustName
FROM (Sales INNER JOIN Customers ON Sales.CustNo = Customers.CustNo) INNER
JOIN Products ON Sales.ProductCode = Products.ProductCode
WHERE (((Sales.Date) Between [Forms]![SalesbySalesman]![StartDate] And
[Forms]![SalesbySalesman]![EndDate]) AND
((Customers.SalesName)=[Forms]![SalesbySalesman]![SalesPerson]))
GROUP BY Customers.CustName, Customers.SalesName
PIVOT "Q" & DatePart("q",[Date],1,0) In ("Q1","Q2","Q3","Q4");
I have the following crosstab query, and am trying to make a few changes.
1) In the PIVOT line, I want to define the quarters as my fiscal quarters
(ie: 1/2/05 - 4-2-05 for Q1) rather than the standard quarters access uses
(1/1/05-3/3105).
2) I would like to make the transform line variable based on a form
parameter. IE: enter "Amount" on the form you get
TRANSFORM Sum(Sales.Amount) AS SumOfAmount.
Enter "Volume" on the form and you get
TRANSFORM Sum(Sales.Volume) AS SumOfVolume
Any help would be greatly appreciated! (SQL below) Thanks.
***************************
TRANSFORM Sum(Sales.Amount) AS SumOfAmount
SELECT Customers.CustName
FROM (Sales INNER JOIN Customers ON Sales.CustNo = Customers.CustNo) INNER
JOIN Products ON Sales.ProductCode = Products.ProductCode
WHERE (((Sales.Date) Between [Forms]![SalesbySalesman]![StartDate] And
[Forms]![SalesbySalesman]![EndDate]) AND
((Customers.SalesName)=[Forms]![SalesbySalesman]![SalesPerson]))
GROUP BY Customers.CustName, Customers.SalesName
PIVOT "Q" & DatePart("q",[Date],1,0) In ("Q1","Q2","Q3","Q4");