Selecting Records based on DB column with list

Ask a Question related to Coldfusion Database Access, Design and Development.

  1. #1

    Default Selecting Records based on DB column with list

    Hi,

    I am stuck (and I think this will end up being a duh/d'oh thing!). I have a
    dbase table called projects (Access) that contains project data. One of the
    columns in the dbase is "employee_list". This column contains a list of
    integers that relate to each employee assigned to a given project.

    When an employee logs into the system to record their time, they are (should
    be) presented with a list of projects currently assigned to them (often,
    multiple employees are assigned to each project). What I need to do, as each
    employee's logon is processed, is find all projects assigned to an employee.

    I want to search the employee_list column to see if the id of the employee
    signing in is in the list. I've tried several things (obviously not the right
    ones) but am stumped. I've included the CFQUERY code below...and some comments.
    If anyone cna point me in the right direction, I would greatly appreciate it.

    Thank you,
    Craig

    <cfquery name="getDetails">
    SELECT clientid, projectid, project_name, project_description, start_date,
    deadline, employeeid AS project_lead, lastUpdate, lastInvoice
    FROM projects
    <!--- I'm stuck here...trying to determine if the employee_list field contains
    the passed in value, selector_id --->
    WHERE employee_list CONTAINS #selector_id#
    <!--- I know the above SQL is incorrect, I just thought this better
    articulates what I want to do --->
    </cfquery>

    craigkaminsky Guest

  2. Similar Questions and Discussions

    1. Delete mulitple records from list based on checkbox?
      Hi - using ASP/ACCESS/VBscript Need an good and not expesive extension for making a page where I can delete multiple records from a list based on...
    2. selecting every Nth records set
      I have about 16000 rows in one column, and looking to grab every 4 rows, and place them into a new table on one row with 4 columns to make 4000 rows...
    3. selecting based on a month in a date
      Hi, Asked this on the mySQL list but it seems to be more of a PHP syntax thing that a mySQL thing. In have the following line in PHP <?php...
    4. Selecting records based on multiple values
      I'm trying to select records which have a FIELD_VALUE = x, y, or z. I've tried several things and I can't seem to make it work correctly. Here is...
    5. how to Add different controls(textBox,DropDownList or some ) in the same column,based upon the value in the previous column (Say second Colum which contain dropdown with some values) ?
      I am new to ASP.NET. I am facing problem with datagrid. I will explain prob now. In the datagrid the first column is name in the second...
  3. #2

    Default Re: Selecting Records based on DB column with list

    <cfquery name="getDetails">
    SELECT clientid, projectid, project_name, project_description, start_date,
    deadline, employeeid AS project_lead, lastUpdate, lastInvoice
    FROM projects
    </cfquery>

    <cfoutput query = "getDetails">
    <cfloop from="1" to="LISTLEN(#project_list#)" index="i">
    <cfif LISTGETAT(project_list,index) is selector_id>
    <!---Output project details here--->
    </cfloop>
    </cfoutput>



    Tulsa Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139