Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. space in-between search parameters

space in-between search parameters

Scheduled Pinned Locked Moved Database
databasesql-serversysadmin
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    acodman
    wrote on last edited by
    #1

    Hi all, I need a way out of this sql server querry. I have a database wich stores username with space in-between. the porblem am having is that when I run a search query using like operator it returns no value. e.g in my table I have a username stored their called "acod man" but i want to search by entering acod since i am using like operator I want it to locate "acod man" for me but it returns nothing select username from tbl_names where username like'%acod%' I will appreciate your responses. thanks in advance.

    S 2 Replies Last reply
    0
    • A acodman

      Hi all, I need a way out of this sql server querry. I have a database wich stores username with space in-between. the porblem am having is that when I run a search query using like operator it returns no value. e.g in my table I have a username stored their called "acod man" but i want to search by entering acod since i am using like operator I want it to locate "acod man" for me but it returns nothing select username from tbl_names where username like'%acod%' I will appreciate your responses. thanks in advance.

      S Offline
      S Offline
      Sgg245
      wrote on last edited by
      #2

      It should work perfectly. I dont see any reason for this query not working. I have tried a similar query as: select c1, c5 from t1 where c5 like 'R%' and this returns all the records for which c5 columns has values starting with 'R'. Juz try it again. Otherwise provide table records and structure... Letz see whats the probs??

      Regards SG (sgg245@yahoo.co.in)

      1 Reply Last reply
      0
      • A acodman

        Hi all, I need a way out of this sql server querry. I have a database wich stores username with space in-between. the porblem am having is that when I run a search query using like operator it returns no value. e.g in my table I have a username stored their called "acod man" but i want to search by entering acod since i am using like operator I want it to locate "acod man" for me but it returns nothing select username from tbl_names where username like'%acod%' I will appreciate your responses. thanks in advance.

        S Offline
        S Offline
        Sgg245
        wrote on last edited by
        #3

        Tell me what is the type of column for which you are doing pattern-matching?? If the datatype of the column is nchar then it will return 0 records. Bcoz then its Unicode pattern - matching... :)

        Regards SG (sgg245@yahoo.co.in)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups