Hi all,
Can someone tell me what I am doing wrong with this Case statement? If I comment out the "between" lines the query works fine. when i put them back in I get the error message 'Incorrect syntax near between'.
CASE procedure_code
when between '27301' and '27599' then 'KNEE INJ'
when between '29866' and '29889' then 'KNEE INJ'
when between '29850' and '29851' then 'KNEE INJ'
when between '73721' and '73723' then 'KNEE INJ'
when between '73560' and '73565' then 'KNEE INJ'
when '20610' then 'KNEE INJ'
when '29530' then 'KNEE INJ'
ELSE 'Nothing'
end as category
Can someone tell me what I am doing wrong with this Case statement? If I comment out the "between" lines the query works fine. when i put them back in I get the error message 'Incorrect syntax near between'.
CASE procedure_code
when between '27301' and '27599' then 'KNEE INJ'
when between '29866' and '29889' then 'KNEE INJ'
when between '29850' and '29851' then 'KNEE INJ'
when between '73721' and '73723' then 'KNEE INJ'
when between '73560' and '73565' then 'KNEE INJ'
when '20610' then 'KNEE INJ'
when '29530' then 'KNEE INJ'
ELSE 'Nothing'
end as category