Can someone tell me how to divide the results of the two "types" in this query?
I need the result to be Terminated/Budgeted. Right now, I get this:
I another row to show .04% as the percentage.
SELECT SUM(ISNULL(ApprovedHrsPerPeriod, 0)) AS Hours, 'Budgeted' AS TYPE
WHERE (Payroll = 'reg') AND (Active = 'y')
SELECT SUM(ISNULL(HoursPerPeriod, 0)) AS Hours, 'Terminated' AS TYPE
WHERE (StatusDate BETWEEN @From AND @Thru) AND (Status = 'TERM') AND (PositionNumber LIKE '%B')