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

using UNION with Parameters

Status
Not open for further replies.

kit2002

Programmer
Nov 6, 2002
7
US
How can I create a UNION between 2 tables AND use the Parameters in the Where clause. I cannot use VIEWS, Crystal Queries, Temp Tables or Stored Procedures as this report is run within GoldMine and GM will only accept straight SQL.
Here is what I want to accomplish;

Select A.id, A.Name, A.State, A.Status, A.Zip from Table A
INNER JOIN Country on A.countryID = country.ID where
A.State = state.Parameter and
A.Zip = zip.Parameter and
A.Status = status.Parameter
UNION
Select B.id, B.Name, B.State, B.Status, B.Zip from Table B
INNER JOIN Country on B.countryID = country.ID wherewhere
B.State = state.Parameter and
B.Zip = zip.Parameter and
B.Status = status.Parameter

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top