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 |
|
barnabeck
Posting Yak Master
236 Posts |
Posted - 2012-06-27 : 05:06:05
|
| The controlparameter I'm feeding the WHERE clause with has a comma-devided values of accountnumbers.e.g.@accounts = '10028801, 10028802, 10028803, 10028804'I need an expression that returns those clients with these accountnumbers:WHERE Accounnumber matches one of the numbers in @accountsAny clue?Martin |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
|
|
meckeard
Starting Member
4 Posts |
Posted - 2012-06-27 : 18:09:16
|
| Like the post above states, you need to SPLIT the string and then compare it. Mark |
 |
|
|
barnabeck
Posting Yak Master
236 Posts |
Posted - 2012-06-28 : 06:42:31
|
| Interesting but too complex subject for the simply query I was working on. In the end I could avoid the creation of the comma-devided value string and thus didn't have to a adopt this.Thanks anyway,Martin |
 |
|
|
waterduck
Aged Yak Warrior
982 Posts |
Posted - 2012-06-29 : 03:15:35
|
| not quite sure will work for youWHERE @accounts like '%' + Accounnumber + '%' |
 |
|
|
|
|
|