SQL select in problem

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default SQL select in problem

    Hi All
    Using asp vbscript
    I have used the SQL statement before where xxx in('yyy') on a numeric data
    field and with a request. string yyy = 1,3,5,7 . All works fine but I
    cannot get it to work on character data ie character field in the database
    and string yyy= M, F, C. Is there a restriction with the in() function
    within SQL that it only works on numeric data. Would appreciate any
    guidance on this
    Many thanks



    Graham Comley Guest

  2. Similar Questions and Discussions

    1. Select Problem
      Hi All, I have a column in my table with values like this: CBMON3.03122005 WESAT1.04262006 TRSAT3.01282006 .. .. ..
    2. Problem with NOT IN and Sub-Select
      I have the following query SELECT vw_mail_add.contact_id, vw_mail_add.first_name, vw_mail_add.last_name, vw_mail_add.address1, vw_mail_add.add2,...
    3. problem with the select query
      Hi people, this is my first mail to the group. i am having a problem with the select query. There are a few values in few columns of a table with...
    4. SELECT mit Parametern: Problem
      Help, an alle, Bin ein Newbie in Perl. Habe eine Datenbank unter Visual Foxpro 6.0 genannt Patwin Unter Perl ActivePerl Win32 5.8.0806, Treiber...
    5. SQL select statement problem...
      I'm not sure if this is possible or not, but this is what I would like to do is something like this: I have two tables. Table A has 4 rows (with...
  3. #2

    Default Re: SQL select in problem

    No restriction. You just have to offset each string with quotes. If you
    just say IN ('"&Request.Form("field")&"'), then all of your form fields are
    in one giant string, like "1,2,3,4,5" instead of "1","2","3","4","5", which
    is what IN expects.

    Use:
    .... IN ('"&Replace(Request.Form("field"),", ","', '")&"') ...

    "Graham Comley" <grahamcomley@yahoo.co.uk> wrote in message
    news:d6ks22$lge$1@forums.macromedia.com...
    > Hi All
    > Using asp vbscript
    > I have used the SQL statement before where xxx in('yyy') on a numeric
    > data
    > field and with a request. string yyy = 1,3,5,7 . All works fine but I
    > cannot get it to work on character data ie character field in the
    > database
    > and string yyy= M, F, C. Is there a restriction with the in() function
    > within SQL that it only works on numeric data. Would appreciate any
    > guidance on this
    > Many thanks
    >
    >
    >

    Lionstone Guest

  4. #3

    Default Re: SQL select in problem


    Hi Lionstone
    Many thanks for the information it worked a treat

    Graham


    Graham Comley 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