SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2004
    Location
    griffith
    Posts
    72
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to filter multiple entries

    I have a database for projects. Some managers are responsible for multiple projects. I want to dynamically populate a list of project managers, choose a manager, and display a complete list of his/her projects. I have a few problems 1) I cannot figure out how to list a project manager's name only once in and 2) I don't have a clue how to compile all the projects for each manager so that when his/her name is chosen it will display all the records. Any advice?

  2. #2
    SitePoint Enthusiast
    Join Date
    Apr 2005
    Posts
    25
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'll have two separate queries. One to pull out a distinct list of all managers, one to pull out manager/project pairs. Populating the manager text box is easy in ASP. Now for the dynamic portion, you'll have to write the manager/project pairs into dynamic client side JavaScript (or VBScript). In other words, you need to create a two-dimensional client side array with the manager/project pairs. You'll need to write this out from your query in ASP.

    Once you have these client side arrays, you can do a lookup in the managerCombo_OnClick event to remove all items from the manager/project combo then loop through the array to add all projects for the currently selected manager. It might sound a little confusing but it's not too bad once you start working through it.

    Jared

  3. #3
    SitePoint Enthusiast
    Join Date
    Feb 2005
    Posts
    74
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    blur...sounds like you have 1 table; hence duplicate names......need t have one tble for managers and 1 for projects. a 1-to-many relationship needs to be created

    for a quick fix but not recommended is to SELECT DISTINCT manager FROM tbl then no duplicate managers

    1 manager can have more than 1 project but i imagine there is a possiblity that 1 project can have more than 1 manager assign to it? please tell us how your db is structured ie:

    tblName
    -------------
    ManagerID(PriKey/auto#)
    LastName(text)
    FirstName(text)

    and also please post code


    thanks


Bookmarks

Posting Permissions

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