J
Jon
I have a report that is based on a crosstab query that displays the
total value of all purchases orders a given person has cut each month
(i.e., Sum(xBuyValTable.Value)). Now I need to add two more columns to
the report for each month and show the number of orders and their
average value. I've created the crosstab query for each value -
Count(xBuyValTable.Value) and Average(xBuyValTable.Value) - but how do
I join the three individual crosstab queries so the report can display
the result?
I've looked at the multiple columns trick that's been referred to here
(the demo uses the Northwind DB and creates Quantity and Quantity*Price
columns) and I don't think it'll work for my problem.
And for the sake of completeness, here's the Sum query:
TRANSFORM Sum(xBuyValTable.Value) AS SumOfValue
SELECT xBuyValTable.BuyerName, Sum(xBuyValTable.Value) AS [Total Of
Value]
FROM xBuyValTable
GROUP BY xBuyValTable.BuyerName
PIVOT Format([Date],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
The Average query only has the first two lines different:
TRANSFORM Avg(xBuyValTable.Value) AS AvgOfValue
SELECT xBuyValTable.BuyerName, Avg(xBuyValTable.Value) AS [Total Of
Value]
And the Count query has these two lines:
TRANSFORM Count(xBuyValTable.Value) AS CountOfValue
SELECT xBuyValTable.BuyerName, Count(xBuyValTable.Value) AS [Total Of
Value]
total value of all purchases orders a given person has cut each month
(i.e., Sum(xBuyValTable.Value)). Now I need to add two more columns to
the report for each month and show the number of orders and their
average value. I've created the crosstab query for each value -
Count(xBuyValTable.Value) and Average(xBuyValTable.Value) - but how do
I join the three individual crosstab queries so the report can display
the result?
I've looked at the multiple columns trick that's been referred to here
(the demo uses the Northwind DB and creates Quantity and Quantity*Price
columns) and I don't think it'll work for my problem.
And for the sake of completeness, here's the Sum query:
TRANSFORM Sum(xBuyValTable.Value) AS SumOfValue
SELECT xBuyValTable.BuyerName, Sum(xBuyValTable.Value) AS [Total Of
Value]
FROM xBuyValTable
GROUP BY xBuyValTable.BuyerName
PIVOT Format([Date],"mmm") In
("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
The Average query only has the first two lines different:
TRANSFORM Avg(xBuyValTable.Value) AS AvgOfValue
SELECT xBuyValTable.BuyerName, Avg(xBuyValTable.Value) AS [Total Of
Value]
And the Count query has these two lines:
TRANSFORM Count(xBuyValTable.Value) AS CountOfValue
SELECT xBuyValTable.BuyerName, Count(xBuyValTable.Value) AS [Total Of
Value]