Why I Prefer Double-Double Quotes ("") Instead of a Single Quote (') in Microsoft Access

Поделиться
HTML-код
  • Опубликовано: 28 июн 2024
  • In this Microsoft Access tutorial, I'm going to explain why I prefer using double-double quotes instead of single quotes in my criteria for strings.
    ERRATA
    The first line inside the DDQ function should be:
    If IsNull(S) Then
    LEARN MORE:
    599cd.com/DDQnotSQ
    PRE-REQUISITES:
    Double Lookup: 599cd.com/DoubleLookup
    Double Double Quotes: 599cd.com/DoubleDouble
    Concatenation: 599cd.com/Concat
    DLookup: 599cd.com/DLookup
    LINKS:
    DDQ Function: 599cd.com/DDQ (Gold Members)
    RECOMMENDED COURSES:
    DDQ in Access Expert 10: 599cd.com/ACX10
    BECOME A MEMBER:
    RUclips: / @599cd
    or My Site: 599cd.com/THMember
    FREE TEMPLATE DOWNLOADS:
    TechHelp Free Templates: 599cd.com/THFree
    Blank Template: 599cd.com/Blank
    Contact Management: 599cd.com/Contacts
    Order Entry & Invoicing: 599cd.com/Invoicing
    More Access Templates: 599cd.com/AccessTemplates
    ADDITIONAL RESOURCES:
    FREE Access Beginner Level 1: 599cd.com/Free1
    $1 Access Level 2: 599cd.com/1Dollar
    Donate to my Tip Jar: 599cd.com/TipJar
    Get on my Mailing List: 599cd.com/YTML
    Contact Me: 599cd.com/Contact
    TechHelp: 599cd.com/TechHelp
    Consulting Help: 599cd.com/DevNet
    Twitter: / learningaccess
    en.wikipedia.org/wiki/Microso...
    products.office.com/en-us/access
    microsoft.com/en-us/microsoft...
    KEYWORDS:
    access 2016, access 2019, access 2021, access 365, microsoft access, ms access, ms access tutorial, #msaccess, #microsoftaccess, #help, #howto, #tutorial, #learn, #lesson, #training, #database, DDQ, SQ, Why use single and double quotes in statements, difference between single and double quotes in SQL, When to Use Quotation Marks In MS Access, Quotation marks within quotes
    QUESTIONS:
    Please feel free to post your questions or comments below. Thanks.

Комментарии • 22

  • @mirchimasala171
    @mirchimasala171 Год назад +3

    Dear Richard .you are only and one hope for access developers....may you live long...keep it up legend Richard ...love from pakistan

  • @Shadow.Dragon
    @Shadow.Dragon Год назад +1

    The "mystery" of the DDQ solved! Thanks for the great explanation on how Access treats single and double quotes!

    • @599CD
      @599CD  Год назад

      Glad it was helpful!

  • @user-dz8uv8ks4h
    @user-dz8uv8ks4h Год назад +2

    As usual Rick, so clear explanations... I've learned so much from your videos.. You are truly a master. In the past, i had no idea how to deal with that syntax and all i did, was trying all the possibilities to make this to work. But now, everything looks so easy..
    Thanks a lot!

    • @599CD
      @599CD  Год назад

      You are very welcome

  • @ozairkhalid
    @ozairkhalid Год назад +1

    thanks

  • @ryanw1906
    @ryanw1906 Год назад

    Don't you want IsNull(S) in your DDQ function? I knew this would be related to Apostrophes but I think Chr(34) & Replace(s,"'","''") & chr(34) still works in those cases. (for my Qt function)

    • @599CD
      @599CD  Год назад

      Yep - always check the notes down below. Realized the error as soon as I posted the video.

  • @mikewashington4188
    @mikewashington4188 Год назад +1

    Using double double quotes always gives me a headache just like time travel examples.

    • @599CD
      @599CD  Год назад +1

      You were late to our Time Travelers Meeting tomorrow.

  • @gregoryjeffries8475
    @gregoryjeffries8475 Год назад

    Handy for dealing with Klingon.

    • @599CD
      @599CD  Год назад

      It does kinda look like Klingon, huh? DdQ' NoT sQ!

  • @navisalomi
    @navisalomi Год назад

    Thanks Richard for stating your reasons. There is a workaround to escape the single quote character.
    Infact, I wrote a function to put the single quotes to clear the headaches all together.
    Anyone may try it to see. The function assumes the string would not contain double quotes.
    Copy and paste function to a module to see the single quotes and escapes clearly. The function can be enhanced to handle double quote. I just think there very slim chances anyone would come across DDQ in a string.
    ====================
    Function replace_escape_quotes(textValue) as String
    If IsNull(textValue) Then Exit Function
    replace_escape_quotes= "'" & Replace(textValue, "'", "''") & "'"
    End Function
    ====================
    With this function all you need to do is call the custom function inside the Dlookup
    =DLookUp("[CreditLimit]","[CustomerT]","[LastName] = " & replace_escape_quotes(Lastname))
    The custom function removes the whole headache altogether. I tested for O'Brien and it worked perfectly.
    I'm very comfortable with DDQ, but single quotes are more readable and modern programming languages like Python makes it even easier to use.

    • @599CD
      @599CD  Год назад +1

      Oh sure... there's always multiple ways to deal with an issue. Thanks for sharing. :)

    • @navisalomi
      @navisalomi Год назад

      Thanks for steering my learning. I had to do some digging. 😀

  • @AlejandroJuarez-je3en
    @AlejandroJuarez-je3en Год назад

    10:01. Hi, Richard, I was expecting to see "If IsNull(S) Then" instead of "If IsNull(DDQ) Then"...

    • @fuego09esmeralda
      @fuego09esmeralda Год назад

      Do you think he left this there to test if we're paying attention...?

    • @599CD
      @599CD  Год назад

      Always read the description

    • @599CD
      @599CD  Год назад +1

      Uh... yeah... uh... it's a test. :)

    • @fuego09esmeralda
      @fuego09esmeralda Год назад

      I knew it...! 🤓