473,721 Members | 2,421 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please can someone help me get a list of absent employees ??

OK, here's the sitch : we have an access control system at work that
registers ever entry/exit of every employee. I recently made some
queries in Access so the ppl in HR could make reports (who came in
late, how many ppl were undertimed, etc etc) Now they are not
satisfied (of course) and they want a list of ABSENT employees.

I have the following tables :

PERSONNEL
CARD
DEPARTMENT
ACCESS_REG (raw entry/exit data)

So I can easily list the employees (along with their card number and
department) that entered/exited on a given date (or range of dates)
.... but when I try to compare that with the list in PERSONNEL and have
Access return the ones that DON'T appear, it tells me the query is too
complex!! Help??

I have it phrased thusly : ("Sorted With Date Search" is a Query that
generates a report by range of dates)

SELECT CARD.CARD_NUMBE R, PERSONNEL.FIRST _NAME, PERSONNEL.LAST_ NAME,
DEPARTMENT.DEP_ DESCRIPTION
FROM (PERSONNEL INNER JOIN CARD ON PERSONNEL.P_ID = CARD.P_ID) INNER
JOIN DEPARTMENT ON PERSONNEL.DEP_I D = DEPARTMENT.DEP_ ID
WHERE CARD.CARD_NUMBE R NOT IN (SELECT CARD_NUMBER FROM [Sorted With
Date Search])

Am I attempting the impossible?? =(
Nov 13 '05 #1
1 2770
Melissa Kay Beeline wrote:
OK, here's the sitch : we have an access control system at work that
registers ever entry/exit of every employee. I recently made some
queries in Access so the ppl in HR could make reports (who came in
late, how many ppl were undertimed, etc etc) Now they are not
satisfied (of course) and they want a list of ABSENT employees.

I have the following tables :

PERSONNEL
CARD
DEPARTMENT
ACCESS_REG (raw entry/exit data)

So I can easily list the employees (along with their card number and
department) that entered/exited on a given date (or range of dates)
... but when I try to compare that with the list in PERSONNEL and have
Access return the ones that DON'T appear, it tells me the query is too
complex!! Help??

I have it phrased thusly : ("Sorted With Date Search" is a Query that
generates a report by range of dates)

SELECT CARD.CARD_NUMBE R, PERSONNEL.FIRST _NAME, PERSONNEL.LAST_ NAME,
DEPARTMENT.DEP_ DESCRIPTION
FROM (PERSONNEL INNER JOIN CARD ON PERSONNEL.P_ID = CARD.P_ID) INNER
JOIN DEPARTMENT ON PERSONNEL.DEP_I D = DEPARTMENT.DEP_ ID
WHERE CARD.CARD_NUMBE R NOT IN (SELECT CARD_NUMBER FROM [Sorted With
Date Search])

Am I attempting the impossible?? =(


A suggestion to help keep it simple.

Select the above SQL string and select Edit/Copy from the menu. In
Access, click Queries/New/Design. When the AddTables is presented,
press Close. From the menu select View/SQL and from the menu select
Edit/Paste. (If you copy the SQL string from my message, be sure to
remove the > lines after pasting)

Now wipe out anything from the word "Where" including Where. IOW, you
have no where clause.

Now select, from the menu, View/Design. You are back in the query builder.

From the menu, select the AddTable button (has a + sign). Select your
[Sorted With Date Search] query. Now drag a line from the card number
in the table CARD to the CARD number field in [Sorted With Date Search].
This sets a relationship between the two tables.

Dbl-click on the relationship line. Select option 2; All records from
Card and those that match in [Sorted With Date Search].

Now drag the Card field from [Sorted With Date Search] into a blank
column in the query builder. Uncheck the Show so it won't be displayed.
In the criteria row for this column enter the words
IS NULL
so that only records where card #s not in the query are displayed.

Close and save the query. Maybe call it AbsentEmps.

This looks like a lot of work, it really isn't.

Of course, you can always use the FindUnmatched query wizard. But if
you know how to do this yourself, you have added another skill set to
your belt.
<rant on>
I HATE spaces in table field names. I HATE spaces in Table, Query,
Form, Report names. HATE, HATE, HATE. Although you can do it, I see
absolutely NO REASON to do so. Ex: [Sorted With Date Search].

If you stay on programming in Access, sooner or later you are going to
kick yourself in the butt for ever using spaces in object names. I
would suggest you desist immediately. However, it's your perogative.

In fact, I even detest naming conventions were people put "tbl" in front
of table names, "qry" in front of query names, "frm" in front of
reports, etc. Why do it...especially if you have a lot of them? To
exercise the eyeballs more?

I STRONGLY support and use putting identifiers in code, as in
Dim intNumber As Integer.
We are talking code tho. In the database window, why do I need to see a
bunch of objects preceeded by tbl, qry, frm, rpt, etc?

Thank you for permitting me to get this off my chest.
<rant off>.




Nov 13 '05 #2

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

Similar topics

4
2657
by: Orion | last post by:
Hi, This is kind of last minute, I have a day and a half left to figure this out. I'm working on a project using ms-sqlserver. We are creating a ticket sales system, as part of the system, I need to be able to do a search for specific tickets withing price ranges, different locations within the theaters, etc. etc. My problem is in the search one of the criteria is to search for a group of seats together. For example let's say...
5
2292
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action to either a) generate numbers b) Prompts a user to locate a web page c) go to previous page in history list d) Loads next page in history list e) Promps the user for a URL and loads the web page in a new window f) and Re-Sizes the window. ...
2
2199
by: ormy28 | last post by:
I really need some help with the following problem if anyone would be willing. I need a list box to list the opposite of what appears in a query. Heres the details: My database is for a doctors surgery, and this includes the tables tblPatients, tblDoctors and tblAppointments. tblAppointments has an Appointment ID and also includes the Patient ID (from tblPatient) and Doctor ID (from tblDoctor) plus the start and end time of the
7
16876
by: Jon Davis | last post by:
I'm managing "collections" / "lists" (??) of objects that are internally bound by an XML document, but I do NOT intend to offer an IEnumerator interface. For instance, with a root XML document, I might have: <employees> <employee><name>bob</name></employee> <employee><name>carl</name></employee> <employees>
2
1695
by: MLH | last post by:
I would like to populate a table with the following information: tblPropertySettings - the GotFocus property setting string - the LostFocus property setting string I'd like to document the above info for all Forms and all Textbox controls on each Form.
2
1292
by: sweyer via AccessMonster.com | last post by:
Okay, so this is my situation. I have a database that stores clients and their corresponding groups. (We're an insurance brokerage, so we have each company's information and each of their clients' information). One of the features of this database is to track mailouts and newsletters. I have a form to add individual clients to the mailouts, but I would like to also be able to choose a company and have it populate ALL of the employee's...
1
1643
by: Zeeshan7 | last post by:
Hi, I want to distribute a list (equally) between employees:- I have two tables in MS Access: 1- Employee table: Fields are; Emp_No, Emp_Name and Billing_Date i.e. 15 (for all employees) 2- Accounts Table: Fields are; Account_No, Customer_Name, Billing_Date i.e. 15 (for all records) and Balance
6
1772
by: leeg | last post by:
Help please. Apologies but I am poor in access and programming :o) and am having trouble getting my head around this one!!...again!!! I need to have a query or report to flag up someone who has been absent for over 8 days + in a 12 month period. the relationship between tables is staffID. My sub table stores the absent occurences against my main Staff Names table. Obviously staff can have one or more occurences of being absent. In my...
2
1186
by: duchessofireland | last post by:
I've been struggling for a few weeks over creating a database. I'm trying to create a way to track work orders placed and completed and who we assigned to the jobs. My biggest issue I've run into is - I can assign anywhere from 1 to 30 people on a job. I need to be able to query by individual employees and also would like to print a report showing all employees on a particular work order. When I used a multi-select list to choose my...
0
8851
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8736
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9227
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9074
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8016
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4491
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4761
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3201
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 we have to send another system
2
2584
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.