• Query error (2002/sp2)

    • This topic has 1 reply, 2 voices, and was last updated 18 years ago.
    Author
    Topic
    #441902

    I’m having a query syntax error. I know what the problem is but I’m not sure of the fix.
    I have this in a query field:

    class2-2: IIf([enrclass2]=2,”It’s a Bug’s World”)

    I get a syntax error message. The problem is the two ‘ and ‘ in the It’s a Bug’s Life

    If I change things to remove the two ‘ and ‘

    class2-2: IIf([enrclass2]=2,”Its a Bugs World”)

    Things work correctly.

    I want the ‘ in there. How do I code it.

    Thanks Paul

    Viewing 0 reply threads
    Author
    Replies
    • #1062317

      Using single quotes in a string shouldn’t be a problem. If I paste your expression in a query of mine, and replace enrclass2 with the name of a field in my query, it works OK. So I suspect something else is wrong – check carefully that the expression in your database is the same as the one you posted.

    Viewing 0 reply threads
    Reply To: Query error (2002/sp2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: