Author |
Topic |
murrayb3024
Yak Posting Veteran
79 Posts |
Posted - 2012-11-28 : 10:13:21
|
Trying to use a the following case statement in a user defined function but not workingSET @dd = CASE @aTotalWHEN @aTotal IN (1,10,19,28,37,46,55,64,73,82,91) THEN 8WHEN @aTotal IN (2,11,20,29,38,47,56,65,74,83,92) THEN 7WHEN @aTotal IN (3,12,21,30,39,48,57,66,75,84,93) THEN 6WHEN @aTotal IN (4,13,22,31,40,49,58,67,76,85,94) THEN 5WHEN @aTotal IN (5,14,23,32,41,50,59,68,77,86,95) THEN 4WHEN @aTotal IN (6,15,24,33,42,51,60,69,78,87,96) THEN 3WHEN @aTotal IN (7,16,25,34,43,52,61,70,79,88,97) THEN 2WHEN @aTotal IN (8,17,26,35,44,53,62,71,80,89,98) THEN 1ELSE 0ENDGet this error: Incorrect syntax near the keyword 'IN'.Can you not do an "IN" in a UDF? |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-11-28 : 10:16:18
|
quote: Originally posted by murrayb3024 Trying to use a the following case statement in a user defined function but not workingSET @dd = CASE @aTotalWHEN @aTotal IN (1,10,19,28,37,46,55,64,73,82,91) THEN 8WHEN @aTotal IN (2,11,20,29,38,47,56,65,74,83,92) THEN 7WHEN @aTotal IN (3,12,21,30,39,48,57,66,75,84,93) THEN 6WHEN @aTotal IN (4,13,22,31,40,49,58,67,76,85,94) THEN 5WHEN @aTotal IN (5,14,23,32,41,50,59,68,77,86,95) THEN 4WHEN @aTotal IN (6,15,24,33,42,51,60,69,78,87,96) THEN 3WHEN @aTotal IN (7,16,25,34,43,52,61,70,79,88,97) THEN 2WHEN @aTotal IN (8,17,26,35,44,53,62,71,80,89,98) THEN 1ELSE 0ENDGet this error: Incorrect syntax near the keyword 'IN'.Can you not do an "IN" in a UDF?
Too old to Rock'n'Roll too young to die. |
|
|
murrayb3024
Yak Posting Veteran
79 Posts |
Posted - 2012-11-28 : 10:20:11
|
wow, totally missed that, thank you. |
|
|
|
|
|