var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Find 'South' not 'South England'
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)
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 ??
If I ask the person searching selects 'South' they will be creating the search where Loction = 'South'
Originally posted by bcrockett
Why won't equals work?
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.
I see. It would be best if you could normalize the database. Failing that, you could try:
when Location contans 'South, London' it will not equal 'South'
WHERE Field_Name = 'SOUTH'
OR Field_Name LIKE '%,SOUTH,%'
OR Field_Name LIKE 'SOUTH,%'
OR Field_Name LIKE '%,SOUTH'