Crosstab Query in ASP.Net Page
am 25.01.2008 02:19:06 von j.t.wHi.
Is there a way to display the results of a crosstab query in some
control on an ASP.Net web form?
I think my first problem is that this query only works in Access and
not via the SQL Query Analyzer or the DataSource wizzard in VWD2005EE.
TRANSFORM Sum([q1].sls_amt) AS SumOfsls_amt
SELECT [q1].prod_cat, Sum([q1].sls_amt) AS [Total Of sls_amt]
FROM (SELECT OEHDRHST_SQL.slspsn_no, OELINHST_SQL.prod_cat,
OELINHST_SQL.sls_amt
FROM OEHDRHST_SQL INNER JOIN OELINHST_SQL ON OEHDRHST_SQL.ord_no =
OELINHST_SQL.ord_no
WHERE OEHDRHST_SQL.inv_dt BETWEEN 20080101 AND 20080131
ORDER BY OEHDRHST_SQL.slspsn_no, OELINHST_SQL.prod_cat) AS q1
GROUP BY [q1].prod_cat
PIVOT [q1].slspsn_no;
Does anyone know or have the correct syntax for a crosstab or pivot
query in SQL Server 2000?
Secondly, if and when I get the query running, what control do I use
to display the results?
Thanks in advance for any and all help.
j.t.w