Results 1 to 3 of 3
  1. #1
    crazycat503 is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    7

    Please help me develop this query that searches projects by their title or employees

    Hi,

    I have this database based on this logic: There are projects in a company. In each project, different employees different roles. One employee could have different roles in a single project. Also, can work in different projects at the same time. Some projects could be added but role of employees could be specified later on.

    Employees: Empid,Empcode,Empname (autonumber,text, text)
    Projects: Projectid,Projectcode,ProjectName (autonumber, text,text)
    Roles: roleid,rolename (autonumber,text)

    EmployeesProjects (autoid,empid,projectid,roleid)

    The database works fine. So far, the company was searching by project code or name. But recently, they want to enter employee name in the same textbox and that would return projects he participated on. Also, the projectname will be searched along with it.

    So, say if projectname is named David's Residence and there is an employee named David (who participated in the project or not), it returns the project and all other projects that an employee whose name includes David has participated in under any role.

    Using access query wizard, I was able to get this done:

    Code:
    SELECT title
    FROM projects INNER JOIN (roles INNER JOIN (employees INNER JOIN EmployeesProjects ON employee.employeeid=EmployeesProjects.empid) ON roles.roleid=EmployeesProjects.roleid) ON projects.projectid=EmployeesProjects.projectid;
    it works fine but returns projects who have information saved in EmployeesProjects table. That is, any project whose inforamtion about employees and their roles in it is not returned.



    As an e.g., i like to have something like the search enginine of beemp3.com where user can search for a song thru its title, album or artist. but the result is always songs.

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    If you mean that when you type in "David's Residence" and search for all David's projects, it's hard to to identify which word is a name of a person (David in this example), maybe you want to search each word in your employee table? do you want to just match any word of a name (first name, last name, mid name)? I think it's too hard and doesn't make any sense doing that if I understand it right.

  3. #3
    crazycat503 is offline Novice
    Windows XP Access 2003
    Join Date
    Dec 2010
    Posts
    7
    Quote Originally Posted by weekend00 View Post
    If you mean that when you type in "David's Residence" and search for all David's projects, it's hard to to identify which word is a name of a person (David in this example), maybe you want to search each word in your employee table? do you want to just match any word of a name (first name, last name, mid name)? I think it's too hard and doesn't make any sense doing that if I understand it right.

    you actually didnt get me but i managed to solve it. thank you.

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

Similar Threads

  1. Replies: 0
    Last Post: 08-06-2010, 06:45 PM
  2. Replies: 2
    Last Post: 06-20-2010, 06:48 AM
  3. Replies: 21
    Last Post: 12-27-2009, 09:19 PM
  4. Replies: 2
    Last Post: 12-15-2009, 10:41 AM
  5. Using Access Projects
    By ragsgold in forum Access
    Replies: 4
    Last Post: 10-24-2009, 04:23 AM

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