Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Comparison condition for string with single quote

Author  Topic 

Lesley249
Starting Member

11 Posts

Posted - 2008-03-26 : 22:46:13
How can solve this problem below when i retrieve the data based on a string with a (')



SELECT * FROM [Table] WHERE Description = 'My flight's No'

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-26 : 23:01:53
Tried this?

SELECT * FROM [Table] WHERE Description = 'My flight''s No'
Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2008-03-26 : 23:02:25
SELECT * FROM [Table] WHERE Description = 'My flight''s No'

That's two single quotes not a double quote.

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Lesley249
Starting Member

11 Posts

Posted - 2008-03-26 : 23:57:46
Yes, it works that everyone !!
Go to Top of Page
   

- Advertisement -