locked
Unclosed Quotation mark RRS feed

  • Question

  • User-797751191 posted

    Hi

      IN below line i am getting above error

    td = +'<a href=''http://localhost:1501/test.aspx?No='+CAST(@ENo AS varchar(10)) + '>''

    Thanks

    Tuesday, July 2, 2019 1:22 PM

Answers

  • User753101303 posted

    Hi,

    The last '' is a single quote in your string and you need to add a 3rd one to really close the string. Anyway it is misplaced (should be before the > character):

    SELECT '<a href=''http://localhost:1501/test.aspx?No='+CAST(@ENo AS varchar(10)) + '''>'

    Edit: or it could be clearer to use double quotes ie :

    SELECT '<a href="http://localhost:1501/test.aspx?No='+CAST(@ENo AS varchar(10)) + '">'

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 2, 2019 1:39 PM

All replies

  • User753101303 posted

    Hi,

    The last '' is a single quote in your string and you need to add a 3rd one to really close the string. Anyway it is misplaced (should be before the > character):

    SELECT '<a href=''http://localhost:1501/test.aspx?No='+CAST(@ENo AS varchar(10)) + '''>'

    Edit: or it could be clearer to use double quotes ie :

    SELECT '<a href="http://localhost:1501/test.aspx?No='+CAST(@ENo AS varchar(10)) + '">'

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Tuesday, July 2, 2019 1:39 PM
  • User-1174608757 posted

    Hi jsshivaik,

    According to the error message, it shows that you have a problem with the use of quotes. You could see that you use a symbol ' at start, but your string   end up with " .

    So as  PatriceSc said , you should modify your string and make your format correct. I hope it could help you.

    Best Regards

    Wei

    Wednesday, July 3, 2019 1:53 AM