Hi,
I'm trying to write a pretty basic report with asp. The inputs are the ledger code (account code) and the start and finish dates of the report. For some reason it doesn't like my query.
I used response.write to show it on screen.
Next I tried copying the query into Access and it worked fine!
Any ideas?
I've included my screen dump and the useful code....
**** screen output *****
SELECT * FROM qryREPORT2 WHERE time_stamp BETWEEN #01/01/01# AND #06/21/01# AND gl = '101/000' ORDER BY time_stamp;
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/po2001/content/reports/report.asp, line 46
**** CODE *****
(the LAST line is line 46, ie the recordset opening)
<%
'declare variables
dim strSQL , strLedger , strStart , strFinish
'grab values passed from previous page which indicate the time period of the report and the relevent ledger
strLedger = request.querystring("Ledger"
strStart = request.querystring("SD"
strFinish = request.querystring("FD"
strSQL = "SELECT * FROM qryREPORT2 WHERE time_stamp BETWEEN #" & strStart & "# AND #" & strFinish & "# AND gl = '" & strLedger & "' ORDER BY time_stamp;"
response.write strSQL
objRS.Open strSQL, objConn
%>
I'm trying to write a pretty basic report with asp. The inputs are the ledger code (account code) and the start and finish dates of the report. For some reason it doesn't like my query.
I used response.write to show it on screen.
Next I tried copying the query into Access and it worked fine!
Any ideas?
I've included my screen dump and the useful code....
**** screen output *****
SELECT * FROM qryREPORT2 WHERE time_stamp BETWEEN #01/01/01# AND #06/21/01# AND gl = '101/000' ORDER BY time_stamp;
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
[Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 2.
/po2001/content/reports/report.asp, line 46
**** CODE *****
(the LAST line is line 46, ie the recordset opening)
<%
'declare variables
dim strSQL , strLedger , strStart , strFinish
'grab values passed from previous page which indicate the time period of the report and the relevent ledger
strLedger = request.querystring("Ledger"
strStart = request.querystring("SD"
strFinish = request.querystring("FD"
strSQL = "SELECT * FROM qryREPORT2 WHERE time_stamp BETWEEN #" & strStart & "# AND #" & strFinish & "# AND gl = '" & strLedger & "' ORDER BY time_stamp;"
response.write strSQL
objRS.Open strSQL, objConn
%>