473,320 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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

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
0 1134

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Dan Evans | last post by:
Hi, Can anyone help me on a little problem I am having with some SQL - in particular on a subquery. I am setting up a database in Access for a voluntary group which runs
2
by: Nachi | last post by:
Hi, Urgent Help appreciated.... I am getting resultset with first condition and when try to get the resutlset from second condition i am getting the above error in SQL200. I know that i am...
7
by: Kannan | last post by:
Hello, I have a situation which would essentially use a co-related subquery. I am trying to avoid using a co-related subquery due to its slow performanc and use a join statement instead. Here...
2
by: edself | last post by:
Greetings, I am semi-new to Access and have a query question. I presume the solution is easy, but need some help. I have created a database with a Contact table. The contact table contains...
1
by: Tim Marshall | last post by:
A2003. I am getting this error message when I try to set a report's recordsource to an SQL statement or a saved querydef that uses sub-queries. I've debug.printed the SQL, and run it as a stand...
5
by: Rod | last post by:
I have a client site where the code below has been working happily for at least four months. The site is using SQL Server 7. The code is ASP.NET Last week an error appeared related to the...
2
by: kevinjbowman | last post by:
I have the following query I wrote in MySQL 5.0 Select eq_employees.empid, eq_sigreturns.returnid From eq_employees Left Join eq_sigreturns ON eq_employees.empid = eq_sigreturns.empid
5
by: Anne | last post by:
Hello! Here is the statement in question: --STATEMENT A SELECT * FROM dbo.myTable WHERE colX in (SELECT colX FROM dbo.sourceTable) The problem with Statement A is that 'colX' does not exist...
1
by: jcf378 | last post by:
Hi all-- Does anyone have any insight as to how I might create a search form that allows a user to select criteria based on any related table in the whole database. The search form I have now only...
3
by: jideesh | last post by:
---------------trigger code create trigger DeletepurchaseItems on table_purchaseitems for delete,update as begin select * from deleted update table_STOCK set ostock=(ostock-(select sqty from...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.