473,387 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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_NUMBER, 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_ID = DEPARTMENT.DEP_ID
WHERE CARD.CARD_NUMBER NOT IN (SELECT CARD_NUMBER FROM [Sorted With
Date Search])

Am I attempting the impossible?? =(
Nov 13 '05 #1
1 2746
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_NUMBER, 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_ID = DEPARTMENT.DEP_ID
WHERE CARD.CARD_NUMBER 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
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...
5
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...
2
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...
7
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,...
2
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...
2
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'...
1
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) ...
6
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...
2
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...

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.