Select records using like statement

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Hamayun Khan
    New Member
    • Aug 2007
    • 106

    #1

    Select records using like statement

    Hi all

    I am using the following query to select records for table

    Select JobTitle,JobDes c,Scraped,logoi mage,JobPostID, SchoolID,web,Me mType,Instituti onName,PayScale ,LEA,Contract as ContractType,Ho ursAbl,StartDat e,ClosingDate,a sap from tblJobScrap Where ((JobTitle like '% Art %' OR JobTitle like '% Art and Design %' OR JobTitle like '% Art & Design %'))

    This query return the records having no keywords like Art ,Art and Design or Art & Design but having words having Start (for St(Art) ,P(art) etc) where I want to retrieve only those records that have Art word.
    I don't know how i can do this
    Any Help in this issue
  • cokelite
    New Member
    • Nov 2008
    • 6

    #2
    Seems to me you don't have spaces around the word Art in your actual query. So use '% Art %' instead of '%Art%'.

    I would do it like this:

    WHERE JobTitle like '% Art %' OR JobTitle like 'Art %' OR JobTitle like '% Art'

    Comment

    • Hamayun Khan
      New Member
      • Aug 2007
      • 106

      #3
      Thank you

      Originally posted by cokelite
      Seems to me you don't have spaces around the word Art in your actual query. So use '% Art %' instead of '%Art%'.

      I would do it like this:

      WHERE JobTitle like '% Art %' OR JobTitle like 'Art %' OR JobTitle like '% Art'
      Thanks for giving a useful Hint. Really work for me

      Comment

      Working...