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