P
Piri
Access97
I have been using a crosstab query from the design view and want to
change it to code.
The SQL derived from the design view is: ( INTO statement added):
strSQL = "TRANSFORM Sum(tblData.Qty) AS Count " _
& "SELECT tbldata.Stock " _
& "INTO [" & TempTable & "] IN '" & TempDBase & "' " _
& "FROM tblData " _
& "WHERE (((tblData.Status)='CO')) " _
& "GROUP BY tblData.Stock " _
& "ORDER BY tblData.Stock " _
& "PIVOT tblData.WeeksBack In
('W0','W1','W2','W3','W4','W5','NW0','NW1','NW2','NW3','NW4','NW5');"
DBEngine(0)(0).Execute strSQL, dbFailOnError
TempTable and TempDBase are/is in/an external MDB I use for holding
temporary data for reports.
I get an error 3000 - reserved error 3002 "there is no message for
this error"
Is it possible to create a table from a crosstab type query?
Piri
I have been using a crosstab query from the design view and want to
change it to code.
The SQL derived from the design view is: ( INTO statement added):
strSQL = "TRANSFORM Sum(tblData.Qty) AS Count " _
& "SELECT tbldata.Stock " _
& "INTO [" & TempTable & "] IN '" & TempDBase & "' " _
& "FROM tblData " _
& "WHERE (((tblData.Status)='CO')) " _
& "GROUP BY tblData.Stock " _
& "ORDER BY tblData.Stock " _
& "PIVOT tblData.WeeksBack In
('W0','W1','W2','W3','W4','W5','NW0','NW1','NW2','NW3','NW4','NW5');"
DBEngine(0)(0).Execute strSQL, dbFailOnError
TempTable and TempDBase are/is in/an external MDB I use for holding
temporary data for reports.
I get an error 3000 - reserved error 3002 "there is no message for
this error"
Is it possible to create a table from a crosstab type query?
Piri