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.
Author |
Topic |
AMB
Starting Member
6 Posts |
Posted - 2007-05-17 : 06:36:48
|
Hi, I have a supllier named K O'Neill and i want to filter on his name in my supplier table . Is this possible ?When I try Vend Name = 'K O%Neill' it does not work.Can anyone help?Thanks. |
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-17 : 06:39:43
|
[code]Where [Name] = 'K O''Neill'[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-17 : 06:51:40
|
You need to double the single quoteTo know how it behaves run thisSelect '','''','''''','''''''',''''''''''MadhivananFailing to plan is Planning to fail |
|
|
AMB
Starting Member
6 Posts |
Posted - 2007-05-17 : 06:55:16
|
the where vend name = 'k o' 'neill' does not work :( |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-05-17 : 07:06:42
|
quote: Originally posted by AMB the where vend name = 'k o' 'neill' does not work :(
where [vend name] = 'k o''neill' Also, don't give space between two consecutive quotes.Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
|
|
AMB
Starting Member
6 Posts |
Posted - 2007-05-17 : 09:53:36
|
Harsh Athalye thank you very much that works :) :) :) |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2007-05-17 : 10:44:26
|
Instead of space it is better to use underscore (_)MadhivananFailing to plan is Planning to fail |
|
|
|
|
|