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!

Combine two queries

Status
Not open for further replies.

Shannon88

Technical User
Mar 4, 2003
17
US
I have two seperate queries performing a different task in each but each query has the identicial field names. The calculations are correct and I want to print them in a report. Since they are in seperate queries I can't get them together. When I combine them it gets all messed up. If this is not possible, then how to I tell a query to perform a calculation when another field says "Free Goods". When and Pay Type is "Free Goods" I want the grand total * .25 Else Free Goods = 0. I guess I am confused on where I should doing this calculation and how to do it. I have tried directly on the report, in the query and I even tried to put it on my print button. I keep running into problems. This is my first time using Project and I am not really good at writing code. Any help would be much appreciative.

Thanks,

Shannon
 
If you want to combine two queries into a single result set you might consider creating a new query that uses 'UNION'.
Both queries MUST return the same columns for this to work.

Note that UNION queries will not display in the graphical query desing window, you'll have to define it in SQL view only.
 
It is easier to give advice if you include an example of the query results that you want to see. Maybe even the query if it is not too large.
 
Thank you everyone for helping me, the union query is exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top