470,612 Members | 2,524 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,612 developers. It's quick & easy.

subquery in a select statement?

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...

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].*
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!


Aug 22 '06 #1
0 1042

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Dan Evans | last post: by
2 posts views Thread by edself | last post: by
2 posts views Thread by kevinjbowman | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.