Results 1 to 13 of 13
  1. #1
    Join Date
    May 2006
    Posts
    386

    Unanswered: Need Urgent Help to filter Employees records in a Query Please!!

    Dear All,

    We have a large database employees on our database but not all of them have done any jobs for us. Now we would like to tidy up the database so that the Query gives us a list of all those employees that actually done jobs on certain dates.

    I have tried to get this information by adding the EmployeesTable and JopsTable but when I run the query, it shows me employees names several times because they have done several jobs for us. I want to the query to show me name of each employee only once if they have done any jobs for us. I know i should filter it by DateOfJOb but when I did that i get their names many times for each date they had done a job.

    I am pressurised by my bos to get this sorted but am having extremly difficult time. Any help would be highly appreciated.
    Emi-UK
    Love begets Love, Help Begets Help

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Use a GROUP BY clause in the query. I can't elaborate more without knowing the structures of the tables being involved.
    Have a nice day!

  3. #3
    Join Date
    May 2006
    Posts
    386
    Basically, the way I was thinking it would or should work is to filter employees by " DateOfJob Is not Null and then write some filter or etc to only show their names once as long as they have done a job on a date. I hope this helps. Thank you for your support.
    Emi-UK
    Love begets Love, Help Begets Help

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    The GROUP BY clause combines records with identical values in the specified field list into a single record. See: GROUP BY Clause - Access - Office.com
    Have a nice day!

  5. #5
    Join Date
    May 2006
    Posts
    386
    I am sorry but I read through the explanation but I just could not work out how to do this. Perhaps your kind step by step guidance would be much appreciated.
    Emi-UK
    Love begets Love, Help Begets Help

  6. #6
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    As I wrote in my first answer, I cannot be more precise without knowing the structures (metadata: column names + data type) of the tables being involved in the query and exactly what (list of column names) you want to see in the resulting data set.
    Have a nice day!

  7. #7
    Join Date
    May 2006
    Posts
    386
    Hi Sinndho,
    Thank you for your swift response. Here is what I have in my query

    One table called tblemployee another table called tblbooking. I have the following fields from my tblemployee table in the query list:

    FirstName Surname Email

    I then have the following field from my tblbooking table

    DateOfJob

    I would like this query to show me a list of all those employees that have done one or more jobs for us but I want their names to appear as once in the list.

    Please let me know if you need more information.
    Emi-UK
    Love begets Love, Help Begets Help

  8. #8
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I cannot write such a query with the information you provided. It's not precise enough (see my former post).
    Have a nice day!

  9. #9
    Join Date
    May 2006
    Posts
    386
    What other information do you need as this is what I want in a query and what i have inserted from these two tables? Please advise.
    Emi-UK
    Love begets Love, Help Begets Help

  10. #10
    Join Date
    May 2006
    Posts
    386
    Any help please? I am really in a huge problem. Please help.
    Emi-UK
    Love begets Love, Help Begets Help

  11. #11
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    have you actually tried to use a group by clause?
    I'd rather be riding on the Tiger 800 or the Norton

  12. #12
    Join Date
    May 2006
    Posts
    386
    yes, i have but it doesnt work, May be i need more step by step help please?
    Emi-UK
    Love begets Love, Help Begets Help

  13. #13
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    so what was the SQL you tried
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •