Results 1 to 9 of 9
  1. #1
    ryainad is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    8

    Multiple values comparison.

    Hi there,



    I got 3 tables called Skills, Employee and Position. Tables Employee and Position have Skills column which is multiple valued.
    I need to fetch every employee who has set of skills that is required in given Position. What I am trying to do is to compare set of skills in Employee and Position and select employees with full match of skills.

    Below, I attached my ERD diagram of database

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ryainad is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    8
    Quote Originally Posted by June7 View Post
    Thank you for the advice.
    I've read the article, but still dont know how to make the query.
    What I need is to enter any Position and get every Emloyee, who has skills that are required for that Position.

    Now, I have this query to get Position to know what skills are required:
    [Position]![Position Name]=[Enter Position]
    But I don't know how to fetch not only Employees who has that Position, but those who has skills of that Position.

  4. #4
    recyan's Avatar
    recyan is offline Expert
    Windows 2K Access 2000
    Join Date
    Dec 2011
    Posts
    662
    Not the answer to your question.
    Do not know if I have understood things correctly :

    1) one SKILL can be associated with many POSITION.
    2) One POSITION can be associated with only one SKILL.
    3) One EMPLOYEE can be associated with only one POSITION.
    4) One POSITION can be associated with many EMPLOYEES.
    5) One EMPLOYEE can be associated with only one SKILL.
    6) One SKILL can be associated with many EMPLOYEES.

    Am a bit puzzled as to why SKILL table is associated with POSITION and EMPLOYEE tables directly.

    Thanks

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Position table shows skills requireded, Employee table shows skills employee has? Could employee have skills not required by position, or not have skills required by position?

    I don't use multi-value fields. Could you provide project? Make copy, remove confidential data, run Compact & Repair, zip if large, attach to post.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    ryainad is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    8
    Hi, thank you for response.

    1) one SKILL can be associated with many POSITION. - YES
    2) One POSITION can be associated with only one SKILL. (not exactly one Position can be associated with multiple value of Skills, i.e. with many SKILLs)
    3) One EMPLOYEE can be associated with only one POSITION. - YES
    4) One POSITION can be associated with many EMPLOYEES. - YES
    5) One EMPLOYEE can be associated with only one SKILL. (not exactly one EMPLOYEE can be associated with multiple value of SKILLs, i.e. with many SKILLs)
    6) One SKILL can be associated with many EMPLOYEES. - YES

    SKILL table is associated with POSITION and EMPLOYEE tables directly, because EMPLOYEE may have set of SKILLs different from POSITION set of skills.

    I hope its clear. If you have more question I'll try to answer.

    Thanks.

  7. #7
    ryainad is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    8
    Quote Originally Posted by June7 View Post
    Position table shows skills requireded, Employee table shows skills employee has? Could employee have skills not required by position, or not have skills required by position?

    I don't use multi-value fields. Could you provide project? Make copy, remove confidential data, run Compact & Repair, zip if large, attach to post.
    Yes, Position table shows skills requireded, Employee table shows skills employee has. Yes, Employee can have not required by Position, but Employee has to have all Skills required by Position.

    I need to create a query to find all Employees who has Skills, required by Position. This query will be used in case if we have an available Position and we need to find Employee who may be promoted or upgraded with higher Position.

    Thanks

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,623
    Try this series of queries:

    EmployeeSkills
    SELECT Employee.EmployeeID, Employee.FullName, Employee.skills.Value
    FROM Employee;

    PositionSkills
    SELECT Position.Position_ID, Position.[Position Name], Position.skills.Value
    FROM [Position];

    SkillsPosEmp
    SELECT PositionSkills.[Position Name], EmployeeSkills.FullName, Skills.Skill_Name, "X" AS Hash
    FROM Skills INNER JOIN (PositionSkills LEFT JOIN EmployeeSkills ON PositionSkills.Position.skills.Value = EmployeeSkills.Employee.skills.Value) ON Skills.Skill_ID = PositionSkills.Position.skills.Value
    ORDER BY PositionSkills.[Position Name];

    Matrix
    TRANSFORM First(SkillsPosEmp.Hash) AS FirstOfHash
    SELECT SkillsPosEmp.PositionSkills.[Position Name], SkillsPosEmp.EmployeeSkills.FullName
    FROM SkillsPosEmp
    GROUP BY SkillsPosEmp.PositionSkills.[Position Name], SkillsPosEmp.EmployeeSkills.FullName
    PIVOT SkillsPosEmp.Skill_Name;
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  9. #9
    ryainad is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jan 2012
    Posts
    8
    Thanks, its working.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA problem with IF comparison. HELP.
    By spkoest in forum Programming
    Replies: 6
    Last Post: 05-04-2011, 03:29 AM
  2. Multiple Values, Different Quantities?!
    By Swilliams987 in forum Forms
    Replies: 11
    Last Post: 01-20-2011, 07:35 PM
  3. Comparison Feature Help
    By Kapelluschsa in forum Access
    Replies: 2
    Last Post: 10-25-2010, 06:43 AM
  4. Inserting Multiple values
    By rajath in forum Access
    Replies: 1
    Last Post: 05-14-2010, 04:17 AM
  5. Comparison
    By VICTOR HUGO in forum Access
    Replies: 8
    Last Post: 02-10-2010, 04:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums