Monthly Archives: January 2016

Casting numbers

CASE WHEN DC_yr1_CHP IS NOT NULL OR DC_yr1_CHP =0
THEN ‘$’ + CAST( CAST(( replace(ISNULL(chapterdues1,0),’$’,”)
+ replace(ISNULL(DC_yr1_SOC,0) ,’$’,”)) AS DECIMAL(10,2)
)AS VARCHAR(30))
ELSE ‘$’ + CAST(CAST(( replace(ISNULL(DC_yr1_SOC,0),’$’,”) ) AS DECIMAL(10, 2)) AS VARCHAR(30))
END AS DC_yr1_total,
CASE WHEN DC_yr2_CHP IS NOT NULL
THEN ‘$’
+ CAST(CAST(( replace(ISNULL(chapterdues1,0),’$’,”) * 2 + replace(ISNULL(DC_yr2_SOC,0),’$’,”) ) AS DECIMAL(10,
2)) AS VARCHAR(30))
ELSE ‘$’+ CAST(CAST( replace(ISNULL(DC_yr2_SOC,0),’$’,”) AS DECIMAL(10, 2)) AS VARCHAR(30))
END AS DC_yr2_total ,
CASE WHEN DC_yr3_CHP IS NOT NULL
THEN ‘$’+ CAST(CAST(( replace(ISNULL(chapterdues1,0),’$’,”) * 3 + replace(ISNULL(DC_yr3_SOC,0),’$’,”) ) AS DECIMAL(10,
2)) AS VARCHAR(30))
ELSE ‘$’+ CAST(CAST(replace(ISNULL(DC_yr3_SOC,0),’$’,”) AS DECIMAL(10, 2)) AS VARCHAR(30))
END AS DC_yr3_total /*,
Total1 ,
CASE WHEN total2 IS NULL THEN ‘$0.00’
ELSE total2
END AS total2 ,
CASE WHEN total3 IS NULL THEN ‘$0.00’
ELSE total3
END AS total3
*/