Crosstab Query in ASP.Net Page

J

j.t.w

Hi.

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
 
J

j.t.w

Mark,

Sorry for not getting back to you earlier.

It took me a while to figure it out but it works.

Thank you for your help.
j.t.w
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top