Apostrophe In Field-Value Problem
-
I am using MSSQL and I have a value named NUG(4'') in a field named Sz in the table tbl_Sz. But when i use the query -> Select count(*) from tbl_Sz where Sz='NUG(4'')', it gives the count zero, which should be one in this case. Is the count is zero due to NUG(4'') has two Apostrophes ? Because I think sql ignores the string after the Apostrophe or something like that? If it is so then how to solve this problem ?
-
I am using MSSQL and I have a value named NUG(4'') in a field named Sz in the table tbl_Sz. But when i use the query -> Select count(*) from tbl_Sz where Sz='NUG(4'')', it gives the count zero, which should be one in this case. Is the count is zero due to NUG(4'') has two Apostrophes ? Because I think sql ignores the string after the Apostrophe or something like that? If it is so then how to solve this problem ?
Hi. Single quotes must be escaped (with single quotes) in queries:
Select count(*) from tbl_Sz where Sz='NUG(4'''')'
Kjetil