stored proc snippet - SQL Menace |
12-Sep-07 02:20:43
|
Try this
SELECT @currentVacationAccrualRate =
CASE
WHEN @PPE_ToDate BETWEEN 0 AND 48 THEN 3.34
WHEN @PPE_ToDate BETWEEN 49 AND 120 THEN 5.00
WHEN @PPE_ToDate > 120 THEN 6.67
END
Denis The SQL Menace
http://sqlservercode.blogspot.com
http://sqlblog.com/blogs/denis_gobo/default.aspx |
 |
| |
stored proc snippet - TheSQLGuru |
12-Sep-07 02:40:10
|
I believe the example you use (which is one of TWO available syntaxes for
the CASE statement) can only test ONE single value of @PPE_ToDate for each
WHEN clause. See SQLMenace's solution for the one that allows you to test a
range of values.
--
TheSQLGuru
President
Indicium Resources, Inc. |
 |
| |
stored proc snippet - rodcha |
12-Sep-07 03:38:02
|
thanks everyone for the help.
rod. |
 |
| |