Can someone fix this query for me? I have been at it for an hour and can't locate the rogue error
ISNULL(CAST(CONVERT(DECIMAL(18,4)(COUNT(CASE WHEN soldStatus IN ('Yes', 'Pending') THEN saleTotal ELSE NULL END))) AS FLOAT)/NULLIF(CAST(CONVERT(DECIMAL(18,4),(COUNT(DISTINCT(saleTotal))) AS FLOAT),0),0) As Percentage