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 |
|
kky2k
Starting Member
3 Posts |
Posted - 2009-02-25 : 16:11:25
|
| how can I insert an apostrophe to the following:CASEWHEN code.cd = '12345' THEN 'Kim's List' (Can't get it to come up as Kim's List)ENDThanks!!!Kim |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-25 : 16:13:12
|
quote: Originally posted by kky2k how can I insert an apostrophe to the following:CASEWHEN code.cd = '12345' THEN [Kim's List] (Can't get it to come up as Kim's List)ENDThanks!!!Kim
|
 |
|
|
mfemenel
Professor Frink
1421 Posts |
Posted - 2009-02-25 : 16:21:24
|
| Double the apostrophe in Kim's.then 'Kim''s List' endMike"oh, that monkey is going to pay" |
 |
|
|
kky2k
Starting Member
3 Posts |
Posted - 2009-02-25 : 16:34:47
|
| try both, receiving a missing keyword error. please advise.Thanks,Kim |
 |
|
|
kky2k
Starting Member
3 Posts |
Posted - 2009-02-25 : 16:37:32
|
| opps..my mistake. I made a typo along the way. the double apostrope did the trick. Thank you so much for the help!!! |
 |
|
|
LoztInSpace
Aged Yak Warrior
940 Posts |
Posted - 2009-02-26 : 07:12:04
|
| Without knowing your actual problem this might be better solved by having a table and joining to it.Even something likeselect * from blah inner join(select 12345 cd ,'kim''s list' desc union allselect 65323 , 'loztinspace''s list' ) as liston blah.cd=list.cdif you need a default then outer join and coalece to the default value.Depends on your situation though. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-03-02 : 02:54:44
|
| http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspxMadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|