Search for chars in keys

Results 1 to 7 of 7

Thread: Search for chars in keys

  1. #1
    Patrik Guest

    Default Search for chars in keys

    PLZ Need urgent help before my day at work is to end<BR>so that I can sleep well tonight :)<BR><BR>How would I make a propper...<BR>SQL = "Select * from TABLE where Key contains 2 "a"<BR>Basically I wana find all keys that contains a number<BR>of characters.<BR><BR>Whould be greatefull 4 help on this on

  2. #2
    New ASP Guest

    Default RE: Search for chars in keys

    what is your DB? Access or Oracle?

  3. #3
    Join Date
    Dec 1969

    Default RE: Search for chars in keys

    Using the Like keyword in SQL<BR><BR>SELECT * FROM DbTable WHERE Key Like &#039;%aa%&#039;<BR><BR>The % depends on what database you are using of course, as Access, SQL server, Oracle, etc use different wild card chars. Look up LIKE in your Db&#039;s help section

  4. #4
    Patrik Guest

    Default RE: Search for chars in keys

    I&#039;m using Access DB, yeah I know what U&#039;r thinking but this is what I got.<BR><BR>What I&#039;d like to do is finding keys containing<BR>"1,1,1" to "1,1,?" not numreric and not keys containing<BR>"1,1" or "1,1,1,1"<BR><BR>Does this sound strange or what ?<BR>I&#039;m confused my self :)

  5. #5
    New ASP Guest

    Default ??

    You can use oracle function to do it.<BR><BR>As I don&#039;t know if you are using ORACLE

  6. #6
    New ASP Guest

    Default Try this

    SELECT *<BR>FROM tbl<BR>WHERE the_field LIKE &#039;%a%a%&#039; AND the_field NOT LIKE &#039;%a%a%a%&#039;

  7. #7
    Patrik Guest

    Default RE: Try this

    (Access)<BR>That might work but if I&#039;d like to <BR>select &#039;?,?&#039; there would be lots of AND NOT Like &#039;?,?,?&#039;<BR>AND NOT Like &#039;?,?,?,?&#039; and so on.<BR><BR>Isn&#039;t there a way to select something like this:<BR>SELECT * FROM tbl WHERE field LIKE &#039;?,%&#039; AND<BR>(field(findThis(",")) NOT = 2

Posting Permissions

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