sql query need Help about Absent Employee

  • 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....

  • 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.

    😎

  • 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
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • I am using a Visual Basic 6.0 and a Microsoft Access database..

  • 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.

    😎

  • 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...

  • 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.

    😎

  • 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...

  • Still not giving enough info. Perhaps reading this will help:

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

    😎

  • 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')

Viewing 10 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic. Login to reply