Results 1 to 4 of 4
  1. #1
    Join Date
    Feb 2003
    Posts
    15

    Unanswered: Find 'South' not 'South England'

    Hi

    can anyone provide me with what they would concider to be the best solution for searching for an exact match within a field.

    The situation is I have a fieldd which contains values eg:

    > South,South England,South London etc.....

    or if only 1 value is stored (coma generated when two values are stored)

    > South

    I need to be able to seach the Field for ones which a user will select from a drop down box.

    At the moment I am using INSTR(Field_Name, 'South')

    but obviously this will return those with South anywhere in the Field

    What would be the best way to deal with this... Any ideas ??


    Thanks

  2. #2
    Join Date
    Jan 2003
    Location
    Duncan BC Canada
    Posts
    80
    Why won't equals work?

  3. #3
    Join Date
    Feb 2003
    Posts
    15
    Originally posted by bcrockett
    Why won't equals work?
    If I ask the person searching selects 'South' they will be creating the search where Loction = 'South'

    this is ok if the filed only contains South but when Location contans 'South, London' it will not equal 'South' and will not be found.

  4. #4
    Join Date
    Jan 2003
    Location
    Duncan BC Canada
    Posts
    80
    when Location contans 'South, London' it will not equal 'South'
    I see. It would be best if you could normalize the database. Failing that, you could try:

    Code:
    WHERE Field_Name = 'SOUTH'
       OR Field_Name LIKE '%,SOUTH,%'
       OR Field_Name LIKE 'SOUTH,%'
       OR Field_Name LIKE '%,SOUTH'
    Bradley

Posting Permissions

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