Access 2007 - Query Help

apg071
apg071 used Ask the Experts™
on
I have written a query in Access which references two separate queries

Q1 - List of current staff
Q2 - List of activites carried out by staff

I would like to return all rows from Q1 whether or not there is data returned from Q2 but i get a message saying invalid operation !

Can anyone help

Many thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2006
Commented:
did you try the left join?

what is the field that links q1 to q2?

SELECT q1.*, q2.*
FROM q1 LEFT JOIN q2 ON q1.someid = q2.someid


if they are seperate altogether you can use union

select * from q1
union all
select * from q2

but ensure the number of columns in each query is the same
Top Expert 2006

Commented:
Please can you tell us what you have done

Also you gave zero feedback so how can one help you further?

and this statement "I would like to return all rows from Q1 whether or not there is data returned from Q2"
can be resolved by using a left join (or right join)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial