Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
Programming
»
General
»
sql query need Help about Absent Employee
sql query need Help about Absent Employee
Rate Topic
Display Mode
Topic Options
Author
Message
oliver8615
oliver8615
Posted Saturday, June 14, 2008 7:49 PM
Forum 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
Lynn Pettis
Lynn Pettis
Posted Saturday, June 14, 2008 7:59 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:52 PM
Points: 21,635,
Visits: 27,495
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
Jeffrey Williams 3188
Jeffrey Williams 3188
Posted Saturday, June 14, 2008 8:04 PM
SSCarpal Tunnel
Group: General Forum Members
Last Login: Friday, May 17, 2013 11:21 AM
Points: 4,317,
Visits: 9,216
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
oliver8615
oliver8615
Posted Saturday, June 14, 2008 8:13 PM
Forum 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
Lynn Pettis
Lynn Pettis
Posted Saturday, June 14, 2008 8:31 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:52 PM
Points: 21,635,
Visits: 27,495
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
oliver8615
oliver8615
Posted Saturday, June 14, 2008 9:18 PM
Forum 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
Lynn Pettis
Lynn Pettis
Posted Saturday, June 14, 2008 9:35 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:52 PM
Points: 21,635,
Visits: 27,495
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
oliver8615
oliver8615
Posted Saturday, June 14, 2008 9:43 PM
Forum 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
Lynn Pettis
Lynn Pettis
Posted Saturday, June 14, 2008 9:50 PM
SSC-Insane
Group: General Forum Members
Last Login: Yesterday @ 11:52 PM
Points: 21,635,
Visits: 27,495
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
shiningworld_4u
shiningworld_4u
Posted Tuesday, March 30, 2010 1:03 AM
Forum 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 »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.