Skip to main content
Navigator | Tier 3
February 25, 2022
Question

A360 - Excel As Database - Syntactical Error in update statement when using a comma(,) in address field

  • February 25, 2022
  • 4 replies
  • 285 views

I want to update an address field in an excel with a comma(,) in it by connecting the Excel As Database.

Steps Tried:

1) Placed a backslash in front of the comma. (Ex: 'New Street\, Mumbai')

2) Used both single and double quotes to enclose the string value.

 

Is there any other way to escape the comma?

    4 replies

    Ashwin A.K
    Navigator | Tier 3
    February 25, 2022

    Hi @Ambarish S​ ,

     

    Would you be so kind as to explain the exact operation you are trying to perform?

    I was able to perform an UPDATE using the following query:

     

    UPDATE [Sheet1$$]

    SET [TestColumn] = REPLACE([TestColumn],',','')

     

    There isn't a need to escape the comma with a backslash.

     

    If this is not what you were looking for then please give us an example so that we will be in a better position to assist you.

     

    Kind Regards,

    Ashwin A.K

    Blogs at TheCodingTheory - https://www.thecodingtheory.com
    Ashwin A.K
    Navigator | Tier 3
    February 27, 2022

    Hi @Ambarish S​ ,

     

    No problem, glad you were able to figure out the solution on your own!

     

    Kind Regards,

    Ashwin A.K

    Blogs at TheCodingTheory - https://www.thecodingtheory.com
    Navigator | Tier 3
    February 27, 2022

    Hello @Ashwin A.K​,

    The actual issue was not with the Comma(,), it was with the apostrophe(') from some other field which I just saw.

     

    Got the issue resolved by adding another apostrophe next to it.

     

    Anyway Thank you so much for your response.

    Navigator | Tier 3
    February 27, 2022

    The actual issue is not with the Comma (,) It is with the apostrophe(') which resolved by adding another apostrophe ('') next to it.