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

Joining queries in the report

Status
Not open for further replies.

Deepika15

Technical User
May 4, 2008
7
GB
Hi

I have 3 different queries.
Query 1:Group2,Group1,units and dollars
Query 2:Group2,Group1,units dollars
Query 3:Group2,Group1,units dollars

I want to join all the 3 queries in 1 query as I need all the 6 measures (Units and dollars from 3 different queries in one query)

For query 2 and query 3 queries,There are 2 separate query subjects in the package and I have Item code but the item code that exists in 2 need not necessarily should exist in 3.

For query 1,there is other query subject in the package and there is no item code in this query subject.

Now i need to include all the 6 measures (units and dollars) in one query as i need to do some calculations on the measures.
Can anybody explain in detail how is it possible to achieve
 
Group 1 and group 2 (whatever they constitue) would be the composite key. I'd say choose query 2 as master and join on group1/group2 to the 2 other queries with outer join at the query 2 side.

Now, with regard to the itemcode, where does this fit into the picture?

Ties Blom

 
Hi Thanks for your reply.

But incase if I do a left outer join taking query 2 as the master then the items existing in query 2 need not exist in query 3 and viceversa.how can i consider the query 2 as master query?

or any other solution to achieve this?
 
Full outer join? In that case you need to use coalesce in dataitem definition to be able to define calculations between objects from different queries..

Ties Blom

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top