You can try something like this: DECLARE @TempTotal int SELECT @TempTotal=sum(ti.totalsales) from ti select d.deptdesc,v.[name],ti.deptcode ,(sum(ti.totalsales)/@TempTotal) as Total from tot_item ti, dept d, item i, vendor v where ti.itemcode=i.itemcode and v.vendorid=i.vendorid and ti.deptcode=d.deptcode group by v.[name], ti.deptcode, d.deptdesc ORDER BY v.[name], ti.deptcode ASC