Link to home
Start Free TrialLog in
Avatar of hologosesh
hologoseshFlag for United States of America

asked on

How do I create a select statement with an outerjoin on access queries?

I have an asp page that queries an access query.  I now need to join the query results from one query with those from another query in the same db. My question is how do I outer join vwResults8.Team on vwResults2.Team.  My existing select statement is:

SELECT Team,  SUM(EffectiveRevenueReal) AS Rev From vwResults2 GROUP BY Team Order By SUM(EffectiveRevenueReal) DESC

I'd like to select all fields from vwResults8 and join on vwResults8.Team
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

I'm writing this as though you want ALL records from vwResults2 and matching from vwResults8.  If the other way around, change LEFT to RIGHT.  If all from both, change LEFT to FULL
SELECT Team,  SUM(EffectiveRevenueReal) AS Rev,
  vwResults8.*
From vwResults2 LEFT Outer Join vwResults8 on vwResults2.Team = vwResults8.Team
GROUP BY Team Order By SUM(EffectiveRevenueReal) DESC

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Daniel Wilson
Daniel Wilson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hologosesh

ASKER

Works great, thanks.