Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

add second recordset to first

Status
Not open for further replies.

moleboy

IS-IT--Management
Oct 10, 2002
33
GB
I have two record sets being returned as below

1)
date code 0-1 1-2 3-4
1/1/03 90 2 9 5
2)
available
12

how can i add the second to the first as below????

date code 0-1 1-2 3-4 available
1/1/03 90 2 9 5 12

thanks
 
Hi...
can you post your queries(for both recordsets)

----
TNX.
E.T.
 
Yes, if it's at all possible, write the query to return all the information at once, moleboy. You might want to research JOIN in SQL... that will return what you want even if the data comes from two different databases.

If it's not at all possible to do a JOIN (much easier), and you KNOW that the second recordset is always going to have the one column (available), then I would use getRows() to put the data into two arrays, and then combine the arrays.

~RJ

************
RudeJohn
************
 
sorry working from home without access to work SQL server. the queries both are generated from a stored procedure and are both dependent on a single input parameter, nothing else.

the first query is a
select date, code,
case(when x between y return 1 else 0) AS [0-1],
case(when x between y return 1 else 0) AS [1-2],
case(when x between y return 1 else 0) AS [2-3]
From tblsample, tblsample2
where deptid= @deptID

second is

select average
from tblother
where otherdeptid= @deptID

does this help any??
 
rudejohn,

can you give an example of how I would use get rows do that as I cant use a join
 

_____________________________________________________________________
Please help! I'm falling asleep over here!
onpnt2.gif

 
Couldn't have said it better myself. :)

************
RudeJohn
************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top