September 10, 2013 at 2:58 pm
How to approach Table driven for Business logic calculation instead of Case statement in store procedure?
Any help would be greatly appreciated.
September 10, 2013 at 3:41 pm
Can you provide some more details?
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
September 10, 2013 at 7:53 pm
Thanks for the immediate response
I have stored procedure that will update the pretable before loading to target table
Here is code: this logic should be table driven instead of calling from case statement:
CASE IsNull(received date , '')
WHEN '' THEN CASE RIGHT(Policy_No, 1)
WHEN 'Portfolio' THEN
ROUND(((0.1 * (Interest-Actual_paid)) / 180) * (Montly_date-30),2)
ELSE
'0.00'
END
END
FROM Pretbl a
WHERE Montly_date > 30
AND RunID IN ('21','108')
AND t NOT IN ('100','101')
AND Paid IN ('0', '1')
AND Type<> 'A'
AND ST IN ('xx', 'yy')
Could you please suggest.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply