form field list and SQL IN

Ask a Question related to Macromedia ColdFusion, Design and Development.

  1. #1

    Default form field list and SQL IN

    I'm writing a query that creates a .csv file dependant on the results of a
    search. The search is working fine with the exception of the IN statement which
    doesn't like CF

    The user has the option of selecting multiple age ranges
    ('u_24','25-34','35-44','45-54','55+').
    The form returns these as a list eg. u_24,25-34,55+

    I'm changing the list using <cfset form.age = ListChangeDelims(#form.age#,
    "','", ",")>

    Which when output looks fine, but refusees to work with the SQL.

    Any ideas?

    Species_Evolution Guest

  2. Similar Questions and Discussions

    1. Binding form field to table field.
      I have a form and a table to which I've added a new field. The form field is currently unbounded. When I try to bind the field using the data...
    2. Searching a column containing a list against a form list
      I have a form that allows users to select multiple items from a list. form.hobbies = 1,5,3,6,8,2 (from a table pullup) I want to be able to...
    3. Defined text field in form -> subject field in e-mail
      Hi, I have a form on my web site which users send to me by mailto-function. I would like the text they write in a particular text field to...
    4. copy and paste form RTF document into field in asp form cause it to bypass field length and javascript validation - how to overcome?
      I have a web form with several fields. If I copy & paste from a RTF document into a field, the javascript validation and field length are bypassed...
    5. Dynamic List based on form field data
      --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.500 / Virus Database: 298 -...
  3. #2

    Default Re: form field list and SQL IN

    Not sure why your changing the delimiter, but this is how I do it

    Where yourColumn IN (#ListQualify(form.age, " ' ")#)

    Note space inserted so you can see what is there.

    Ken


    The ScareCrow Guest

  4. #3

    Default Re: form field list and SQL IN

    Hi

    can you post your generater query here.?
    i think if you are separating the values with "," then it will works fine...may the last comma may give error.

    vkunirs Guest

  5. #4

    Default Re: form field list and SQL IN

    Ken,

    Works fine, thanks for the help.

    Spencer
    Species_Evolution 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