Search code examples
sqlms-accessquotation-marks

How do I search for words *including* quotation marks in Access/SQL


I need to distinguish ‘"Omreisende"’ from ‘Omreisende’ in an SQL search. How do I write such a query? The solutions I have found thus far (such as this one), specifically try to circumvent the quotation mark, whereas I need to differentiate strings with them from those without them.

MS Access 2007 running towards an Oracle server.

Thanks in advance!


Solution

  • In MS-Access you need to do it like this:

    Quotation Marks in Access

    [LastName] = """strName"""
    

    In Oracle: Quotation Marks in Oracle

    [LastName] = '''strName'''
    

    So in MS-Access the Escape-operator is the double quotes " and in Oracle it is the single qoutes '