Hi,

Please let me know whats wrong with syntax of the following query, its written in MS Access format:

Select count(*) from [Demographics/Job Data Table] D1 WHERE EXISTS (Select (*) from [Demographics/Job Data Table] D2 where [D2].[Supervisor ID] = [D1].[Employee #] and [D2].[Termination]=Yes)

I am getting a syntax error message when I try to save this query in Access. :(

Recommended Answers

All 2 Replies

Hi,

I got the above problem fixed but my goal is still far away.. Here is the scenario:

I have a table Employees where I have EmpID and SupID, now I wish to count the number of Employee under each Supervisor.. sounds naive but I am just learning..

please help me come up with this query..

You need help in Access but you are posting this under MySQL Forum. I never worked with Access, I can tell you a query for MySQL which you can modify to fit in Access.

SELECT SupID, COUNT(EmpID) as EmpCount FROM Employees
GROUP BY SupID
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.