Results 1 to 2 of 2
Sep 24, 2003, 20:40 #1
- Join Date
- Sep 2003
- 0 Post(s)
- 0 Thread(s)
Having ASP problems with an advanced SQL statement
I am trying to track down where the error is.
Below is the code that I am working on:
SQL = "CREATE TABLE #t (WeekData INT); insert into #t select DatePart(ww, SubmitDate) from support where DatePart(yyyy, SubmitDate) = 2003 and DatePart(mm, SubmitDate) = 6; CREATE TABLE #t2 (JobNumbers INT); insert into #t2 select Count(WeekData) from #t group by WeekData; select * from #t2;"
rst.open SQL, oConn, adOpenStatic
<FONT SIZE="5" COLOR=""><B>Weekly job average/B> <%=rst(0)%><%=rst(0)%></FONT><br><br>
Essential what I am trying to do is take some records that are in a particular month and then find what the weekly average is. To do this I have had to create a couple of temporary tables to house the data. When I run the above SQL statement in SQL Auery Analyser (comes with SQL server) I get correct information but when I put it into my ASP code I get the follow error:
ADODB.Recordset error '800a0cc1'
Item cannot be found in the collection corresponding to the requested name or ordinal.
/apps/support/report.asp, line 78
Now the line that it is falling over on is where the <%=rst(0)%>, and from what I have read the error message means that it can't find the field in the table.
Am I trying to use SQL that will not work with ASP or am I missing something.
Sep 25, 2003, 19:32 #2
That error is commonly used as well when you mispell tables or fields that don't existFree Science Homework Help