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 Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

data from two recordsets

Status
Not open for further replies.

apple17

Programmer
Joined
Jul 5, 2005
Messages
46
Location
US
I have data from two recordsets, Program and NewProgram, that need to be listed on one page. How do I co-mingle them in a list, so they are all in one alphabetical list?

 
What do your SQL statements look like?

If they have the same number/type of fields you may be able to do a union on the two SQL statements, reducing it to one SQL query and then add an ORDER BY to the whole thing.
So if you had:
"SELECT myString,myNumber FROM TableA"
and
"SELECT someString, someNumber FROM TableB"

you could combine them like so:
"(SELECT myString, myNumber FROM TableA) UNION (SELECT someString as myString, someNumber as myNumber FROM TableB) ORDER BY myString"

That may be a bit off, I haven't used a UNION in a couple months so my memory has already faded a bit, but the general logic ought to be sound (if your DB supports Unions).

-T

barcode_1.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top