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 |
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2009-02-12 : 09:39:55
|
| What am I missing? I'm not getting any results:declare @doc varchar(300)select @Doc = '"300","200"'select * from iclaimswhere doc in(@Doc)I want the user to be able to enter in two choices for a DOC so they could enter 300, 200. I need the comma in between. |
|
|
sodeep
Master Smack Fu Yak Hacker
7174 Posts |
Posted - 2009-02-12 : 09:41:05
|
quote: Originally posted by JJ297 What am I missing? I'm not getting any results:declare @doc varchar(300)select @Doc = '"300","200"'select * from iclaimswhere doc in(@Doc)I want the user to be able to enter in two choices for a DOC so they could enter 300, 200. I need the comma in between.
Did you search for it? |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-12 : 09:48:10
|
quote: Originally posted by JJ297 What am I missing? I'm not getting any results:declare @doc varchar(300)select @Doc = '"300","200"'select * from iclaimswhere doc in(@Doc)I want the user to be able to enter in two choices for a DOC so they could enter 300, 200. I need the comma in between.
it should bedeclare @doc varchar(300)select @Doc = '300,200'select * from iclaimswhere ',' + @Doc + ',' LIKE '%,' + CAST(doc AS varchar(10)) + ',%' |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
|
|
JJ297
Aged Yak Warrior
940 Posts |
Posted - 2009-02-12 : 10:00:11
|
| Thanks Visakh16 that's it.Thanks Peso for the documentation this is helpful! |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-02-12 : 10:07:35
|
welcome |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2009-02-12 : 10:19:33
|
Good luck! E 12°55'05.63"N 56°04'39.26" |
 |
|
|
|
|
|