Skip to main content
Inspiring
March 16, 2008
Answered

Selecting Data With an Apostrophe

  • March 16, 2008
  • 2 replies
  • 296 views
I must be missing something simple, this apostrophe issue is getting the best of me...

I have an Access table of county names, one of them is O'Brien.

After reading all that I can find I've tried all of these queries but never get a record back. Please help I'm obviously confused.

I tried all three of these and I get zero records every time:

Lyndon

    This topic has been closed for replies.
    Correct answer Dan_Bracuk
    The 2nd one should have worked. Maybe it's the data. What happens when you try

    where county = 'O''Brien'

    that's two single quotes between the O and the B.

    Also try

    where county like 'O%'

    2 replies

    Inspiring
    March 17, 2008
    Good call Dan. The user typed an accent` instead of apostrophe. It was very hard to see.

    Thanks
    Dan_BracukCorrect answer
    Inspiring
    March 16, 2008
    The 2nd one should have worked. Maybe it's the data. What happens when you try

    where county = 'O''Brien'

    that's two single quotes between the O and the B.

    Also try

    where county like 'O%'