Results 1 to 5 of 5

Thread: Select * From <table> Where <textfield> like ',@%'

  1. #1

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211

    Select * From <table> Where <textfield> like ',@%'

    Hi, I'm trying to do query using this script:

    Select * From <table> where <textfield> like ',@%'

    the problem is that no record is being retrieved. Is there a way for me to search for special characters on textfields? Thank you very much
    C++ Programming is overwhelming.

    Dont let it overwhelm you or you'll fall into the oblivion of its perfection

  2. #2
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Select * From <table> Where <textfield> like ',@%'

    have you tried this
    Select * From <table> where <textfield> like '%,%@%'
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  3. #3

    Thread Starter
    Addicted Member charmedcharmer's Avatar
    Join Date
    Sep 2003
    Posts
    211

    Re: Select * From <table> Where <textfield> like ',@%'

    It somehow works but unfortunately it doesn't display the data that I need. What I need is to query all records from that table based on the textfield with the starting text of the field is ",@'.

    Your script does something else that I can't explain in words. Im sorry
    C++ Programming is overwhelming.

    Dont let it overwhelm you or you'll fall into the oblivion of its perfection

  4. #4
    Shared Member
    Join Date
    May 2005
    Location
    Kashmir, India
    Posts
    2,277

    Re: Select * From <table> Where <textfield> like ',@%'

    Quote Originally Posted by charmedcharmer
    What I need is to query all records from that table based on the textfield with the starting text of the field is ",@'.
    Then your original query will work properly.
    Select * From TABLENAME Where FIELDNAME Like (',@%')

    Quote Originally Posted by charmedcharmer
    Your script does something else that I can't explain in words. Im sorry
    The query posted in my previous post will search all the records which contain , or @ in the field.
    Use [code] source code here[/code] tags when you post source code.

    My Articles

  5. #5
    Don't Panic! Ecniv's Avatar
    Join Date
    Nov 2000
    Location
    Amsterdam...
    Posts
    5,343

    Re: Select * From <table> Where <textfield> like ',@%'

    You haven't stated what db you are using. Check it help files. There is usually an escape charact you can use before special characters. I think it is \ or / (can't remember which).

    If you look up the help files on like operator it should mention something there. Or search escape characters online?

    BOFH Now, BOFH Past, Information on duplicates

    Feeling like a fly on the inside of a closed window (Thunk!)
    If I post a lot, it is because I am bored at work! ;D Or stuck...
    * Anything I post can be only my opinion. Advice etc is up to you to persue...

Posting Permissions

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



Click Here to Expand Forum to Full Width