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.