Am I right in coming to the conclusion that there is no built in method for
creating crosstab queries in MS SQL 2000? I have form the reference under
"Pivot" in SQL books that demonstrates how to build your own but it doesn't
account for scenarios where I don't know how many column headings I require.
I have mocked up this SQL text in MS Access which shows what I want but I
can't seem to generate such a result set in SQL.
Any Ideas?
SQL Text:................
TRANSFORM Sum(testoutput.JobCount) AS SumOfJobCount
SELECT testoutput.Client, testoutput.ContractName,
testoutput.OfficeLocationID, [Request Month] & ' ' & [Request Year] AS ReqMth
FROM testoutput
GROUP BY testoutput.Client, testoutput.ContractName,
testoutput.OfficeLocationID, [Request Month] & ' ' & [Request Year]
PIVOT testoutput.TradeCategory;
creating crosstab queries in MS SQL 2000? I have form the reference under
"Pivot" in SQL books that demonstrates how to build your own but it doesn't
account for scenarios where I don't know how many column headings I require.
I have mocked up this SQL text in MS Access which shows what I want but I
can't seem to generate such a result set in SQL.
Any Ideas?
SQL Text:................
TRANSFORM Sum(testoutput.JobCount) AS SumOfJobCount
SELECT testoutput.Client, testoutput.ContractName,
testoutput.OfficeLocationID, [Request Month] & ' ' & [Request Year] AS ReqMth
FROM testoutput
GROUP BY testoutput.Client, testoutput.ContractName,
testoutput.OfficeLocationID, [Request Month] & ' ' & [Request Year]
PIVOT testoutput.TradeCategory;