There is a pivotTable feature in MDB and in ADP. It is pretty crappy.
What i really and honestly reccomend-- i am quite passionate about this
Use ANALYSIS SERVICES-- these; by definition allow you to do COLUMNs
and ROWs like what you're looking for.
it is about 1 billion times more powerful than Access crosstabs lol
Or.. wait for SQL 2005 express edition; it will allow you to use the
PIVOT keyword (which is similiar to the transform-- crosstab--
functionality in MDB).
for a simple example; it is possibly to do with derived tables; it
really depends on how many records you're talking about.
most people try to do crosstab type queries; but they're scanning the
table multiple times
if you do it as a derived table; it has decent performance
Select
SUM(Case When Month = '1' Then derived1.TotalSales Else 0) as 'Jan'
SUM(Case When Month = '2' Then derived1.TotalSales Else 0) as 'Feb'
SUM(Case When Month = '3' Then derived1.TotalSales Else 0) as 'Mar'
SUM(Case When Month = '4' Then derived1.TotalSales Else 0) as 'JApr'
SUM(Case When Month = '5' Then derived1.TotalSales Else 0) as 'May'
SUM(Case When Month = '6' Then derived1.TotalSales Else 0) as 'Jun'
SUM(Case When Month = '7' Then derived1.TotalSales Else 0) as 'Jul'
SUM(Case When Month = '8' Then derived1.TotalSales Else 0) as 'Aug'
SUM(Case When Month = '9' Then derived1.TotalSales Else 0) as 'Sep'
SUM(Case When Month = '10' Then derived1.TotalSales Else 0) as 'Oct'
SUM(Case When Month = '11' Then derived1.TotalSales Else 0) as 'Nov'
SUM(Case When Month = '12' Then derived1.TotalSales Else 0) as 'Dec'
FROM
(
Select Month(Orders.OrderDate) as Month, sum(OrderDetails.Extended) as
TotalSales
From orders inner join orderdetails on orders.orderid =
orderdetails.orderid
) derived1
I hope my syntax is close on that; it's hard to write without havnig
real data and being able to test it
-Aaron