Query to see if type is present in table

rmacnair

New member
Local time
Today, 03:33
Joined
Mar 9, 2014
Messages
6
I have 3 tables:

- tbl_Positions {containing information on a specific job role}
- tbl_Office {containg information on an office}
- tbl_StaffDetails {containing information of all staff in the company, inlcluding a relationship with tbl_Office to say which office they are working out of}

I want to do a simple query saying what type of staff are working out of each office:

e.g.

If in Office 1 I might have a managing director, CEO and 2xOperations managers etc.

If in Office 2 I might have 5xAdmin, 3xHR, 6xIT help etc.



What sort of query can I run to return just a list of job titles for those present in the office I choose
 
you need a select query. Without details of the tables the follwoing is a guess at what it would look like

Code:
SELECT DISTINCT officename, titlename 
FROM tbloffice inner join tblpositions on tbloffice.officePK=tblpositions.officeFK
 
If you want to know the numbers of staff with each title at particular location you can experiment with the 'Count' fields. Add the totals to your query in design view (via totals button in the ribbon).

You would need to first make a query listing all the different titles at each location with the titles repeating, then make a second query looking at your first to have Counts of the positions at each office.

Hopefully this makes some form of sense... feel free to ask about these ideas.
 

Users who are viewing this thread

Back
Top Bottom