March 10, 2003 at 6:29 pm
VB6 using ADO.
I have 2 recordsets that have the same structure, Does anyone know how to add 2 recordsets togeather. I'm trying not create a temp table.
March 11, 2003 at 1:54 am
Instead of actually creating two recordsets just create a single one with a singe SQL query. Example:
SELECT a, b FROM foo
UNION
SELECT c, d FROM bar
Columns in resultsets must be of same datatype and in the same order. Names from the first resultset will be used for columns. If you want to include duplicates (or if you are sure there are no duplicates) use UNION ALL instead.
--
Chris Hedgate @ Apptus Technologies (http://www.apptus.se)
March 11, 2003 at 5:05 am
If you want to really, truly add two recordsets together, there are a couple ways. First would be to loop through one recordset and add each to the second. Another would be to save both out as XML, then use a transform (or other, better approach?) to merge them, then load back up into a recordset.
Andy
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply