multiple recordset outputs with asp

hi, i have these two recordsets returned from sql procedures - how can i group them in a asp report ?

customerid,chargeid,desc,q'ty,unit_price
1,100,mrc,1,10.00
1,100,ld,1,60.00
1,100,void,-1,(60.00)

customerid,chargeid,payment_type,value
1,100,cash,20.00
1,100,change,(10.00)

report output:
customerid:1,chargeid:100
mrc,1,10.00
ld,1,60.00
void,-1,(60.00)
cash,20.00
change,(10.00)
nevyana2006Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pateljituCommented:
Please see attached code reference, also see article that explains how to work with multiple recordset:

http://databases.aspfaq.com/database/how-do-i-deal-with-multiple-resultsets-from-a-stored-procedure.html
<%
dim strMainOutput, strOutput
SQL = "select 1 as customerid, 100 as chargeid, 'mrc' as [desc], 1 as [q'ty], '10.00' as unit_price UNION ALL "_ 
    &" select 1 as customerid, 100 as chargeid, 'il' as [desc], 1 as [q'ty], '60.00' as unit_price UNION ALL  "_ 
    &" select 1 as customerid, 100 as chargeid, 'vois' as [desc], -1 as [q'ty], '(60.00)' as unit_price  "_ 
    &" select 1 as customerid, 100 as chargeid, 'cash' as payment_type, '20.00' as value union all "_ 
    &" select 1 as customerid, 100 as chargeid, 'change' as payment_type, '10.00' as value "

set rs = conn.Execute(SQL)

if not RS.eof then
    Do while not rs.EOF
        
        strMainOutput = "customerId: "& rs("customerId") &", chargeId:"& rs("chargeid") &"<br>"
        strOutput = strOutput & rs("desc") &","& rs("q'ty") &", "& rs("unit_price")&"<br>"
        
    rs.MoveNext
    loop
end if

set rs = rs.nextRecordset()
if not RS.eof then
    Do while not rs.EOF
        
        strOutput = strOutput & rs("payment_type") &","& rs("value") &"<br>"
        
    rs.MoveNext
    loop
end if

Response.Write(strMainOutput & strOutput)

%>

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Vista

From novice to tech pro — start learning today.