June 4, 2015 at 8:06 am
WHERE
CASE @UWDECISSION
WHEN 'DECLINED' THEN (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE = 'T644')
WHEN 'POSTPONED' THEN (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE = 'TA63')
ELSE (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE IN ( 'T644','TA63'))
END
i am getting error like this
"An expression of non-boolean type specified in a context where a condition is expected, near 'AND'"
could you please help me to fix this error. advance thank you.
June 4, 2015 at 8:19 am
kuchanarajendraprasad (6/4/2015)
WHERECASE @UWDECISSION
WHEN 'DECLINED' THEN (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE = 'T644')
WHEN 'POSTPONED' THEN (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE = 'TA63')
ELSE (SELECT [TBL_IL_PTRNPF].BATCTRCDE FROM [TBL_IL_PTRNPF] WHERE BATCTRCDE IN ( 'T644','TA63'))
END
i am getting error like this
"An expression of non-boolean type specified in a context where a condition is expected, near 'AND'"
could you please help me to fix this error. advance thank you.
The logic you posted there should evaluate to TRUE or FALSE (1 or 0) for the WHERE clause syntax to be correct. Are you forgetting to compare the result of the CASE statement to a certain value?
For best practices on asking questions, please read the following article: Forum Etiquette: How to post data/code on a forum to get the best help[/url]
June 4, 2015 at 8:26 am
CASE
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
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply