September 29, 2008 at 10:17 am
I keep getting an incorrect syntax error on this CASE statement.
(Msg 156, Level 15, State 1, Line 5
Incorrect syntax near the keyword 'like'.
Can you not use the % character in a CASE statement or is the overall syntax wrong? Thank you.
Update Billed
set bill_amount =
Case When product_Code like '%0000' then STATE_DUES
When product_code like 'CHAPT/%' and not like '%0000' Then Local_dues
Else '9999'
End
where billed.ID = '123456'
September 29, 2008 at 10:25 am
Hi Roger:
Update Billed
set bill_amount =
Case When product_Code like '%0000' then STATE_DUES
When product_code like 'CHAPT/%' and product_code not like '%0000' Then Local_dues
Else '9999'
End
where billed.ID = '123456'
Cheers
ChrisM
For fast, accurate and documented assistance in answering your questions, please read this article.
Understanding and using APPLY, (I) and (II) Paul White
Hidden RBAR: Triangular Joins / The "Numbers" or "Tally" Table: What it is and how it replaces a loop Jeff Moden
September 29, 2008 at 10:39 am
Thanks! I should have tried that!
Roger
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply