By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,009 Members | 1,487 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,009 IT Pros & Developers. It's quick & easy.

subquery in a select statement?

P: n/a
Good day all,

Access novice here and have been stuck for a few days on what would
take me two seconds in vba, but isnt that always the pain, now I want
it done this way!

I have a table (Input data) containing "persons" who perform "tasks"
from a "begin date" till an "end date".
Now I have also created a table containing graph (filter) items (graph
data) (containing only one record, with a "person" (or blank), a "task"
(or blank) ...., so I can query for all tasks "Dan" or "Joey" do (based
from a form that fills the query table). However I would also like to
get an overview of all tasks of both Dan and Joey, I would like to
leave the record item in the graph items table for "person" empty. Then
I thought I run something a little like this...

SELECT [iNPUT DATA].*
FROM [iNPUT DATA], [GRAPH DATA]
WHERE (((IsNull([Graph data].[person]))=True));

which gives me a list of all persons if my graph data.person field is
left empty and on the other side I get an empty list if there is name
in the person field in the graph data table.

So now right join this to my graph data.person and this would result in
a list of all names when the field was empty or with just the graph
data.person entry if it was there.

So here my effort comes to do this:
SELECT [input data].*
FROM [graph data]
right JOIN [SELECT [input DATA].*
FROM [iNPUT DATA], [GRAPH DATA]
WHERE (((IsNull([Graph data].[person]))=True))].
ON [Input data].person=[graph data].person;

obviously this is not working, otherwise I wouldnt be here.. but what
am I doing wrong? I came across bracketing the second select and
putting a "." behind it.. done that.. not working... I am stuck! Would
love some support! Thanks all in advance!

Dick

Aug 22 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.