troubleshooting Question

Append records to a SQL Query

Avatar of kdeutsch
kdeutschFlag for United States of America asked on
ASP.NETSQL
4 Comments1 Solution216 ViewsLast Modified:
I am not sure if append is the correct word.  What I am trying to do is pull information from another database and put it at the end of the exisitng information I am showing.  The following is my SQL query what I want to do is query another database with this query but have that information show up after the 1st query of information.

 sql = "select orgstrUPC, orgstrUPC + ' - (' + orgstrUname + ')' from cms.dbo.tblOrganization " _
            & "where orgstrUPC not in (select strUIC from tblUIC where intTaskForceID = " & id & ") " _
            & "AND (orgstrUName NOT LIKE '%FMS%') AND (orgstrUName NOT LIKE '%FWD%') AND (orgstrUName NOT LIKE '%RSP%') " _
            & "order by orgstrUPC"

After this query is finished I then need to show information from another database here as well.  the database is  cmsAF   and the tables are strUIC and strUnit.

So in the end this would all be on big query that show all this unit information but the 1st query would show up first and then the second one would follow.
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros