Help needed insearching

  • have a data like in a name field like below

    Martins

    Martin's

    how can I get both record when some one passes in search input string only Martins withouth single quote.

    i.e if I pass Martins It should return both Martins and Martin's

    it is a specific case, think in general where uer will pass Martins not Martin.

    I know select * from table1 where [name] like '%martin%' will return all row my question is if we pas '%martins%' .

    can i remove ' single quote it from field in where condition if yes then how?

    Naveed Kamboh

  • Hi,

    Can't you use this:

    Replace([Name],'''','')

    thanks

    Chris

    ----------------------------------------------
    Try to learn something about everything and everything about something. - Thomas Henry Huxley

    :w00t:
    Posting Best Practices[/url]
    Numbers / Tally Tables[/url]

    SQL-4-Life
  • where lower(replace(name,'''',''))='martins'

  • Thanks guys,

    I was trying to replace ' with %. your solution is better.

    cheers

    Naveed Kamboh

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply