Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sql query need Help about Absent Employee Expand / Collapse
Author
Message
Posted Saturday, June 14, 2008 7:49 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, August 30, 2008 8:52 PM
Points: 4, Visits: 35
good Day... i need help about my project in school about employee attendance module. I have a table tblEmployee(EmpId,Name,Dept,Position) and another table tblAttendance(EmpId,date,AmIn,AmOut,PmIn,PmOut)

I need a query that will find those employees who are absent or those employee who does not have an attendance on a specific date... urgent please thanks a lot....
Post #517212
Posted Saturday, June 14, 2008 7:59 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:02 PM
Points: 20,734, Visits: 32,515
We'd love to help you with your school project, but it would be better if you showed us what you have already done to try and solve the problem and what the issues you are having with your code.

We'd also need to see the DDL for the tables, some sample data, and what the expected output would be based on the sample data.

The reason for all this is to help you learn. We can look at what you have done so far, point out areas where you are having issues, and show you better ways of doing things. What we don't want to do, is do your work for you. That wouldn't be right, or even fair to you.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #517213
Posted Saturday, June 14, 2008 8:04 PM
SSCarpal Tunnel

SSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal TunnelSSCarpal Tunnel

Group: General Forum Members
Last Login: Thursday, October 2, 2014 12:09 PM
Points: 4,358, Visits: 9,538
To add to what Lynn has already stated - I think you need to lookup OUTER JOIN's. Once you have posted additional information about the problem, I am sure someone here can help you further.

Jeff


Jeffrey Williams
Problems are opportunites brilliantly disguised as insurmountable obstacles.

How to post questions to get better answers faster
Managing Transaction Logs
Post #517214
Posted Saturday, June 14, 2008 8:13 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, August 30, 2008 8:52 PM
Points: 4, Visits: 35
I am using a Visual Basic 6.0 and a Microsoft Access database..
Post #517215
Posted Saturday, June 14, 2008 8:31 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:02 PM
Points: 20,734, Visits: 32,515
And this helps us know what you've done so far how? Please reread my post and Jeff's post. Based on the information you have provided us so far, we can't help you. As I stated earlier, as this is a school project, you need to show us what you have done to solve the problem. We aren't going to just give you a solution. That would not be right, nor fair to you.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #517216
Posted Saturday, June 14, 2008 9:18 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, August 30, 2008 8:52 PM
Points: 4, Visits: 35
I am using MS VB 6.0 so far i did was to search those employee's who have not take an attendance for a day.. my query for that is...

Select EmpId from tblEmployee not IN (select EmpId from tblAttendance where [date] =#06/06/2008#)

my problem for that is i want to know those employee's who have take a consecutive absences using two dates...
Post #517219
Posted Saturday, June 14, 2008 9:35 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:02 PM
Points: 20,734, Visits: 32,515
You really have missed part of what I asked for earlier. The definition for your tables, some sample data for the tables, the expected output based on the sample data, what you have done so far to solve the problem at hand, and where you are having trouble getting what you want as an answer (the expected results based on the sample data).

I could shoot in the dark all night and not help you solve your problem. You have to help us help you by providing as MUCH information as possible.




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #517222
Posted Saturday, June 14, 2008 9:43 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Saturday, August 30, 2008 8:52 PM
Points: 4, Visits: 35
tblEmployee, tblAttendance has one to many relationship...
Here is a sample form in vb 6.0 what am i using


Searcy Options:
StartDate
End Date

Filter those employee's who have taken consecutive absences and from what date it is...
Post #517224
Posted Saturday, June 14, 2008 9:50 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Yesterday @ 9:02 PM
Points: 20,734, Visits: 32,515
Still not giving enough info. Perhaps reading this will help:

http://www.sqlservercentral.com/articles/Best+Practices/61537/




Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #517225
Posted Tuesday, March 30, 2010 1:03 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Monday, July 12, 2010 2:16 AM
Points: 3, Visits: 13
Hi
I think you need this kind of query

Select EmpId from employee where empid Not In (select EmpId from attendance where date =
'2010-03-29')
Post #892493
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse