473,508 Members | 2,437 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Query to Calculate Turnover?

I have a query (see SQL below) that essentially grabs a list of all
employees terminated during a specific period. What I am needing to do
is to be able to take this number and then divide it by the CURRENT
count of active employees. The problem that I cannot figure out, is
how do I do this by department. Of course all of our departments want
to be able to see their own specific turnover rate. I can figure out
how to do this on a global level, but I can't on a departmental level.
As some background, I am pulling data from PS89 and using MS Access to
manipulate the data.

Please keep in mind that I am rather new to writing queries.

THANKS!

SELECT PUBLIC_PS_UM_EMPLOYEES.EMPLID, PUBLIC_PS_UM_EMPLOYEES.NAME,
PUBLIC_PS_UM_EMPLOYEES.EFFDT_JOB AS EFFECTIVE,
PUBLIC_PS_UM_EMPLOYEES.ACTION, PUBLIC_PS_UM_EMPLOYEES.ACTION_REASON,
PUBLIC_PS_UM_EMPLOYEES.ACTION_RSN_DESCR, PUBLIC_PS_UM_EMPLOYEES.DEPTID,
PUBLIC_PS_UM_EMPLOYEES.DEPTNAME, PUBLIC_PS_UM_EMPLOYEES.JOBCODE,
Departments.Manager, Departments.[Associate Director or Director],
Departments.[Hospital or Corporate Director], Departments.Facility,
PUBLIC_PS_UM_EMPLOYEES.EFFDT_JOB, PUBLIC_PS_UM_EMPLOYEES.JOBTITLE,
PUBLIC_PS_UM_EMPLOYEES.FTE, [EFFDT_JOB]-[HIRE_DT] AS [DAYS EMPLOYED]
FROM PUBLIC_PS_UM_EMPLOYEES LEFT JOIN Departments ON
PUBLIC_PS_UM_EMPLOYEES.DEPTID = Departments.[Department ID]
WHERE (((PUBLIC_PS_UM_EMPLOYEES.EFFDT_JOB) Between [From when?] And [To
when?]) AND ((PUBLIC_PS_UM_EMPLOYEES.ACTION)="TER" Or
(PUBLIC_PS_UM_EMPLOYEES.ACTION)="RET") AND
((PUBLIC_PS_UM_EMPLOYEES.ACTION_RSN_DESCR) Not Like "End of
Appointment") AND ((PUBLIC_PS_UM_EMPLOYEES.JOBCODE) Not In
("9220","4693","4960","5889","6427","6428","6436", "7761","7762","7763","7764","7765","7766","7767"," 7768","7769","7771","7772","7776","8394","8398","8 711","8715","8881","8883","8884","8885"))
AND ((PUBLIC_PS_UM_EMPLOYEES.BUSINESS_UNIT)="HOSPT"));

Aug 3 '06 #1
1 4119
Change/copy your query so that you are only selecting DeptID, DeptName,
DeptID. Click View, Totals. In the totals row of the query, put Group
By in the first two and Count in the last column. This query will give
you a list of departments and the number of employees that have been
terminated.

Now make a similar query only this time make it so it grabs the current
employees. Now you have a list of departments and the number of
current employees.

Make a third query, using the first two and joining on DeptID. Output
DeptID, Dept, [TotalFromQuery1]/[TotalFromQuery2].

Hope that helps!
ja*****@gmail.com wrote:
I have a query (see SQL below) that essentially grabs a list of all
employees terminated during a specific period. What I am needing to do
is to be able to take this number and then divide it by the CURRENT
count of active employees. The problem that I cannot figure out, is
how do I do this by department. Of course all of our departments want
to be able to see their own specific turnover rate. I can figure out
how to do this on a global level, but I can't on a departmental level.
As some background, I am pulling data from PS89 and using MS Access to
manipulate the data.

Please keep in mind that I am rather new to writing queries.

THANKS!

SELECT PUBLIC_PS_UM_EMPLOYEES.EMPLID, PUBLIC_PS_UM_EMPLOYEES.NAME,
PUBLIC_PS_UM_EMPLOYEES.EFFDT_JOB AS EFFECTIVE,
PUBLIC_PS_UM_EMPLOYEES.ACTION, PUBLIC_PS_UM_EMPLOYEES.ACTION_REASON,
PUBLIC_PS_UM_EMPLOYEES.ACTION_RSN_DESCR, PUBLIC_PS_UM_EMPLOYEES.DEPTID,
PUBLIC_PS_UM_EMPLOYEES.DEPTNAME, PUBLIC_PS_UM_EMPLOYEES.JOBCODE,
Departments.Manager, Departments.[Associate Director or Director],
Departments.[Hospital or Corporate Director], Departments.Facility,
PUBLIC_PS_UM_EMPLOYEES.EFFDT_JOB, PUBLIC_PS_UM_EMPLOYEES.JOBTITLE,
PUBLIC_PS_UM_EMPLOYEES.FTE, [EFFDT_JOB]-[HIRE_DT] AS [DAYS EMPLOYED]
FROM PUBLIC_PS_UM_EMPLOYEES LEFT JOIN Departments ON
PUBLIC_PS_UM_EMPLOYEES.DEPTID = Departments.[Department ID]
WHERE (((PUBLIC_PS_UM_EMPLOYEES.EFFDT_JOB) Between [From when?] And [To
when?]) AND ((PUBLIC_PS_UM_EMPLOYEES.ACTION)="TER" Or
(PUBLIC_PS_UM_EMPLOYEES.ACTION)="RET") AND
((PUBLIC_PS_UM_EMPLOYEES.ACTION_RSN_DESCR) Not Like "End of
Appointment") AND ((PUBLIC_PS_UM_EMPLOYEES.JOBCODE) Not In
("9220","4693","4960","5889","6427","6428","6436", "7761","7762","7763","7764","7765","7766","7767"," 7768","7769","7771","7772","7776","8394","8398","8 711","8715","8881","8883","8884","8885"))
AND ((PUBLIC_PS_UM_EMPLOYEES.BUSINESS_UNIT)="HOSPT"));
Aug 3 '06 #2

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

Similar topics

1
2627
by: Laphan | last post by:
Hi Guys I don't want to keep asking for your help all the time on each individual query, so could you please help me to break the myths on the following: 1) I have 2 tables. Once is called...
6
2715
by: Michael Bulatovich | last post by:
I have a very simple db I use for keeping track of hours, tasks, projects, clients etc. It has a form that I use to enter data. Currently the form has a textbox for a field called "start time",...
2
1348
by: Kailey11 | last post by:
This probably is a basic question for most of you, but I am setting up an very simple database - person, date traveled, location and milage - using ACCESS 2000 and I want to add up the milage in...
9
1594
by: HelmutMunich | last post by:
Hello, I am Helmut, my database for multiuser is Frontend/Backend. The turnover file is browsed by VBA for Article numbers to be found in the article table. I use DAO 3.6 lib. The sql Statement...
13
2065
by: Ulv | last post by:
I have a table (TblItems) with fields Lenght, Width and Height as decimalfields. I also have the fields Desc, a text field. In a form I have created this line of code after updating: Desc =...
6
4225
by: Widge | last post by:
I can't believe it but I don't have a clue how to update a table using VBA! What I'm trying to do is: 1) Do a search on the last 3 periods turnover for one client in particular and check to see...
0
1258
by: beebelbrox | last post by:
Greetings all. Once more I must dip into the font of your collective wisdom and request help: I have been given the task of taking an exsisting Access Query and exporting it to excel. There...
12
9123
by: denveromlp | last post by:
Hello, I'm new to Access and trying to calculate a rolling 12 month average from some time data. Each data point is a date and a measurement taken at that date. As far as I can tell, the only...
4
7613
by: student2 | last post by:
Hi :-) I'm using Ms Access 2003 to create a DB for my school project and I need to accomplish the following:- * Calculate balances for stock (inclusive of sales and replenishment to stock) ...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7114
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7321
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1544
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
412
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.