Boyd Lynn | I was having sort of the same problem plus some "divide by zero" errors; below is what I did. Cast it as a float, multiply by 100 and then, with the LEFT function I only show 5 digits. This works for my specific need, maybe you can do the same. This is from one of my report definitions.
************************************** SET ARITHABORT OFF SET ANSI_WARNINGS OFF
select CT.CallTypeID,--EnterpriseName,4) as DNIS, CT.EnterpriseName, HALF.ans8, HALF.ans30, HALF.ans100, HALF.ans130, HALF.ans200, HALF.ans300, HALF.ans500, HALF.ans1000, HALF.ans2000, HALF.Handle_Time, TotalCalls = (HALF.ans8 + HALF.ans30 + HALF.ans100 + HALF.ans130 + HALF.ans200 + HALF.ans300 + HALF.ans500 + HALF.ans1000 + HALF.ans2000), TotalLessThan30 = (HALF.ans8 + HALF.ans30), PerLess85 = LEFT(ISNULL(CAST((HALF.ans8 + HALF.ans30) AS FLOAT)*100 / (HALF.ans8 + HALF.ans30 + HALF.ans100 + HALF.ans130 + HALF.ans200 + HALF.ans300 + HALF.ans500 + HALF.ans1000 + HALF.ans2000),0),5) + '%' from Call_Type CT INNER JOIN (Select CallTypeID, Count(CallTypeID) as NumOfCalls, SUM(AnsInterval1) as 'ans8', SUM(AnsInterval2) as 'ans30', SUM(AnsInterval3) as 'ans100', SUM(AnsInterval4) as 'ans130', SUM(AnsInterval5) as 'ans200', SUM(AnsInterval6) as 'ans300', SUM(AnsInterval7) as 'ans500', SUM(AnsInterval8) as 'ans1000', SUM(AnsInterval9) as 'ans2000', SUM(HandleTimeHalf) as Handle_Time From Call_Type_Half_Hour where CallTypeID in ( :list_calltype ) AND DateTime >= :start_date AND DateTime <= :end_date Group by CallTypeID) HALF on CT.CallTypeID = HALF.CallTypeID
ORDER BY CT.EnterpriseName *****************************
Yes this what I have had to do. It's just a shame that you cannot use a Custom Format to do it automatically. Does Custom Format even work? Thanks for your help |