Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2003
    Posts
    8

    Unanswered: Querying for the # symbol in access

    Hi,

    I have a field in my db thats has for example;

    @hello, &apple, #pear, $banana

    an im using the following query

    SELECT * FROM fruit WHERE ftype LIKE '*#pear*'

    but i get no results return, i know that # is use for dates and stuff, but i carnt even use the search and replace in the table to replace # with something else cause it doesnt find any #!!!

    HELP!

    D

  2. #2
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    # is a reserved symbol...
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  3. #3
    Join Date
    Aug 2003
    Posts
    8
    Is there no way to replace it in access?

  4. #4
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    I don't think so... maybe some access genius around knows the answer which is unknown to me.
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  5. #5
    Join Date
    Dec 2002
    Location
    Préverenges, Switzerland
    Posts
    3,740
    strSQL = "SELECT * FROM fruit WHERE ftype LIKE ""*#pear*"";"
    should work. izy

  6. #6
    Join Date
    Aug 2003
    Location
    Delft, The Netherlands (EU)
    Posts
    447
    The '#' character has no special meaning. I guess, you are working with MS Access 2000, which uses ADO, which changes the wildcard character from '*' to '%'. So try: .... LIKE '#%';
    Make everything as simple as possible, but not simpler! - A. Einstein
    DB Problems? DB Explorer, BTrieve Re-engineering, DB Conversions & ETL? Conversion Tool

  7. #7
    Join Date
    Aug 2003
    Posts
    8
    Cheers for the replies guys,

    I had a change of plan and did a global replace of the # symbol in the csv before I imported it.

Posting Permissions

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