Data Types In SQL
Calculate Yield
(((CASE
WHEN trt.[Name] ='Weekly' THEN (DATEDIFF(wk,tp.StartDate, tp.EndDate)*prp.Amount)
WHEN trt.[Name] ='Fortnightly' THEN ((DATEDIFF(wk,tp.StartDate, tp.EndDate)/2)*prp.Amount)
ELSE (DATEDIFF(m,tp.StartDate, tp.EndDate)*prp.Amount)
END
)-ISNULL(SUM(pe.Amount),0)
)/phv.[Value]
)*100 AS Yield




Comments
Post a Comment