May 19, 2010 at 9:50 am
Which line is the error on? You should have two END statements, one to match the BEGIN, and another to match the CASE. I don't see the second END clause, so I don't know what code is before it. Most likely, there is a syntax error or incomplete statment right before that second END.
May 19, 2010 at 9:55 am
yeah it works adding an END statement it works..
Thanks
May 19, 2010 at 9:56 am
Also, you are erroneously using the table alias "et", without actually declaring it. You need to do one of the following:
1. Declare et: "FROM earned_transaction AS et"
2. Use the full table name: "AND earned_transaction.quarter = @prevQuarter"
or 3. Don't specify a table at all: "AND quarter = @prevQuarter"
May 19, 2010 at 10:03 am
K thanks, but there seems to be problem, i tested this query, it never goes in to else 'Absent' part, means when there is no transaction it has to go there, bit it doesnt..
Please help
May 19, 2010 at 10:06 am
Is it returning NULL instead? You could:
SET @lastQuartRewardState = ISNULL(@lastQuartRewardState, 'Absent')
... at the very end.
May 19, 2010 at 10:21 am
Yes it works, thanks
Viewing 6 posts - 16 through 22 (of 22 total)
You must be logged in to reply to this topic. Login to reply