i am trying to get value in Decimal in this query but unable to get i am getting NULL Value
SELECT CAST(CAST(CAST(SUM(CAST(0 AS INT)) AS DECIMAL(10, 2)) * 100
Way too many CASTs in that SQL
Use a CASE if you don't want to use ISNULL, which is needed because you have NULLIF
SELECT
CAST(
CASE
WHEN SUM(CAST(0 AS INT)) + SUM(CAST(0 AS INT)) + SUM(CAST(0 AS INT)) = 0 THEN 0
ELSE SUM(CAST(0 AS INT)) * 100.00 / (SUM(CAST(0 AS INT)) + SUM(CAST(0 AS INT)) + SUM(CAST(0 AS INT)))
END
AS DECIMAL(10, 2))
Howver, anything divided by zero is undefined or infinity: not zero.