Re: referring previous record of recordset from within sql statement
- From: "Mike Brind" <paxtonend@xxxxxxxxxxx>
- Date: Sun, 15 Oct 2006 19:32:57 +0100
"shripaldalal" <shripaldalal@xxxxxxxxx> wrote in message
news:1160933578.374966.90760@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
basically i just want to avoid showing document_no again if the
previous record in the SQL RESULT recordset (the one we get after doing
the select statement) (not the database) matches the document_no of the
current record position in the recordset
So as anthony says it should go like:
dim docno
docno = ""
do until rs.eof
if docno = rs("document_no") then
response.wirte "<BR> - " & rs("ledger_ac")
else
response.write rs("document_no") & " - " &
rs("ledger_ac")
docno = rs("document_no")
end if
rs.movenext
loop
now instead of doing all this cant this be doine in the sql statement
itself ??? the main purpose is to make the program smaller because
there are lots of such statements in the reports.... makin arrays and
such if then statements code blows up alarmingly.....
Easy. Move the SQL from the pages to the database as saved queries. You'll
get the benefit of execution plans being pre-compiled as well as reducing
the code in your ASP pages.
--
Mike Brind
.
- References:
- referring previous record of recordset from within sql statement
- From: shripaldalal
- Re: referring previous record of recordset from within sql statement
- From: Bob Barrows [MVP]
- Re: referring previous record of recordset from within sql statement
- From: shripaldalal
- Re: referring previous record of recordset from within sql statement
- From: Bob Barrows [MVP]
- Re: referring previous record of recordset from within sql statement
- From: shripaldalal
- referring previous record of recordset from within sql statement
- Prev by Date: Re: referring previous record of recordset from within sql statement
- Next by Date: Re: referring previous record of recordset from within sql statement
- Previous by thread: Re: referring previous record of recordset from within sql statement
- Next by thread: Re: referring previous record of recordset from within sql statement
- Index(es):
Relevant Pages
|