P
PW
I am trying to create a crosstab report in ASP. I'm using ASP/VBScript and
Access database. I used Access to create the SQL query, then copied the SQL
and embedded it in my ASP like this ...
mySQL = ""
mySQL = mySQL & "TRANSFORM Sum(Transactions.Hours) AS SumOfHours "
mySQL = mySQL & "SELECT Transactions.Activity" & myActSecond & " as
myActivity, Sum(Transactions.Hours) AS myHours "
mySQL = mySQL & "FROM Transactions "
mySQL = mySQL & "WHERE CommDate >= #" & myDateFr & "# AND CommDate <= #" &
myDateTo & "# "
mySQL = mySQL & "GROUP BY Transactions.Activity" & myActSecond & " "
mySQL = mySQL & "PIVOT Transactions.Activity" & myActFirst
When I try to output the results, I do it like this ...
rs1.open mySQL,mydsn
Do while NOT rs1.EOF
response.write rs1("myActivity")
response.write ", "
response.write rs1("myHours")
response.write "<br>"
rs1.movenext
Loop
So all I get as output is a list of the "myActivity" and values of
"myHours".
How do I get the other axis as column headings across the top?
TIA,
PW
Access database. I used Access to create the SQL query, then copied the SQL
and embedded it in my ASP like this ...
mySQL = ""
mySQL = mySQL & "TRANSFORM Sum(Transactions.Hours) AS SumOfHours "
mySQL = mySQL & "SELECT Transactions.Activity" & myActSecond & " as
myActivity, Sum(Transactions.Hours) AS myHours "
mySQL = mySQL & "FROM Transactions "
mySQL = mySQL & "WHERE CommDate >= #" & myDateFr & "# AND CommDate <= #" &
myDateTo & "# "
mySQL = mySQL & "GROUP BY Transactions.Activity" & myActSecond & " "
mySQL = mySQL & "PIVOT Transactions.Activity" & myActFirst
When I try to output the results, I do it like this ...
rs1.open mySQL,mydsn
Do while NOT rs1.EOF
response.write rs1("myActivity")
response.write ", "
response.write rs1("myHours")
response.write "<br>"
rs1.movenext
Loop
So all I get as output is a list of the "myActivity" and values of
"myHours".
How do I get the other axis as column headings across the top?
TIA,
PW