Database Management
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDatabase Management

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old January 6th, 2004, 10:06 PM
ironchef ironchef is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Location: Cleveland
Posts: 112 ironchef User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 14 m 34 sec
Reputation Power: 6
what's wrong with this query

HI!

working with access 2000

trying to query all supervisors and the workers that relate to them. when i report this i need it to show the supervisors name of which everone a user selects and the workers under that specific/selected supervisor

This is the query code:
Code:
SELECT [LastName] & ", " & [FirstName] & " " & [MiddleInitial] & "." AS VolunteerName
, First([Address] & ", " & [Address2]) AS VAddress
, [City] & ", " & [State] & " " & [PostalCode] AS Expr1
, Volunteers.HomePhone, Volunteers.MobilePhone
, Volunteers.WorkPhone, Volunteers.EmailAddress
, VolunteerJobs.VolunteerJobID, Jobs.Job
, VolunteerJobs.Supervisor
FROM Volunteers 
INNER JOIN (Jobs INNER JOIN VolunteerJobs ON Jobs.JobID = VolunteerJobs.JobID) 
ON Volunteers.VolunteerID = VolunteerJobs.VolunteerID
GROUP BY [LastName] & ", " & [FirstName] & " " & [MiddleInitial] & "."
, [City] & ", " & [State] & " " & [PostalCode], Volunteers.HomePhone
, Volunteers.MobilePhone, Volunteers.WorkPhone, Volunteers.EmailAddress
, VolunteerJobs.VolunteerJobID, Jobs.Job, VolunteerJobs.Supervisor
HAVING (((VolunteerJobs.Supervisor) Is Not Null));


thanks in advanced.

Last edited by ironchef : January 6th, 2004 at 10:33 PM.

Reply With Quote
  #2  
Old January 7th, 2004, 07:53 AM
r937's Avatar
r937 r937 is offline
SQL Consultant
Click here for more information.
 
Join Date: Feb 2003
Location: Toronto Canada
Posts: 17,912 r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level)r937 User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 12 h 17 m 55 sec
Reputation Power: 1018
"of which everone a user selects" ??

you mean, the user will select a supervisor, and you want to show all the volunteers under that supervisor?

change your HAVING to WHERE

... WHERE VolunteerJobs.Supervisor = selectedsupervisorid

rudy

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDatabase Management > what's wrong with this query


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway