Query Help

G

Golfinray

I have 2 tables, one is School district, the other is school districts that
have projects. I want a query to give me a list of all district and all
districts with projects. Since there are 255 districts and 183 districts with
projects, I want a list of 255 districts with the ones with no projects
blank. In other words:
Districts Districts with projects
alma alma
atkins atkins
conway
cabot cabot

I Just want nothing (a blank) where there is a district with no project. No
matter what I do, it only returns the 183 districts. Help! Thanks so much!!!!!
 
M

Marshall Barton

Golfinray said:
I have 2 tables, one is School district, the other is school districts that
have projects. I want a query to give me a list of all district and all
districts with projects. Since there are 255 districts and 183 districts with
projects, I want a list of 255 districts with the ones with no projects
blank. In other words:
Districts Districts with projects
alma alma
atkins atkins
conway
cabot cabot

I Just want nothing (a blank) where there is a district with no project. No
matter what I do, it only returns the 183 districts. Help! Thanks so much!!!!!


SELECT Districts.District, DWP.District
FROM Districts LEFT JOIN [Districts with projects] As DWP
ON Districts.District = DWP.District
 
G

Golfinray

I faithfully entered it in sql view about 10 times and it gives me a syntax
error every time in the select line. Any suggestions? Thanks!!!

Marshall Barton said:
Golfinray said:
I have 2 tables, one is School district, the other is school districts that
have projects. I want a query to give me a list of all district and all
districts with projects. Since there are 255 districts and 183 districts with
projects, I want a list of 255 districts with the ones with no projects
blank. In other words:
Districts Districts with projects
alma alma
atkins atkins
conway
cabot cabot

I Just want nothing (a blank) where there is a district with no project. No
matter what I do, it only returns the 183 districts. Help! Thanks so much!!!!!


SELECT Districts.District, DWP.District
FROM Districts LEFT JOIN [Districts with projects] As DWP
ON Districts.District = DWP.District
 
M

Marshall Barton

Maybe the syntax needs [ ] around more of your table and/or
field names. If you need help with that, please post the
table and field names that you are using.

You may also need to provide more information about the
table fields and how the tables are related.

It would also help if you posted a Copy/Paste of your
attempted query's SQL view.
--
Marsh
MVP [MS Access]

I faithfully entered it in sql view about 10 times and it gives me a syntax
error every time in the select line. Any suggestions? Thanks!!!

Marshall Barton said:
Golfinray said:
I have 2 tables, one is School district, the other is school districts that
have projects. I want a query to give me a list of all district and all
districts with projects. Since there are 255 districts and 183 districts with
projects, I want a list of 255 districts with the ones with no projects
blank. In other words:
Districts Districts with projects
alma alma
atkins atkins
conway
cabot cabot

I Just want nothing (a blank) where there is a district with no project. No
matter what I do, it only returns the 183 districts. Help! Thanks so much!!!!!


SELECT Districts.District, DWP.District
FROM Districts LEFT JOIN [Districts with projects] As DWP
ON Districts.District = DWP.District
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

sql query won't work 3
Query Problem Help! 4
Query Help Needed! 3
IIF or Len Statement Help 3
query criteria - global variable 2
Group By, Max, many to many 1
Help Please 6
Isnull with a filter problem 4

Top