Dean Mincic (9/22/2015)
Hi cthorn112I think the CASE Statement needs ELSE part, something like
....
,CASE
WHEN appe.plan_id IN (2238,2239,2240,2241,2242,2244,2246,2247,2248,2249,2250,2251,2565,2566)
THEN SUM(pd.premium_amount)
ELSE 0
END AS [Fidelity Premium] --newly added column
...
AND pd.premium_amount IS NOT NULL
...
+1
If doesn't matter whether premium amount is null, the original CASE is instructing not to return anything for the SUM if the plan isn't in the specific list of plans.
----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?