HI everyone, I been looking for the answer for sometime now, thought i would post and see if anyone could help me it. This is the output of my query. F_Div Div_4 Div_5 Div_354 246 0 05 0 400 035 1 0 114After the row 35 i want to add a row for total. I want to add the values of column Div_4 so it would be 246+0+1. The problem i'm having is that the columns are populated from using this logic. Select rr.F_BVT_DIV_NO,(Case When rr3.F_DIVISION_NO = 4 then Max(rr3.Total_Pol_Count) else 0 end ) + (MAX(isnull(rr2.Div4,0))) Div_4from RNEWL_RTENTN_DETL RR--join for division 4 transfersleft join(selectrr2.F_BVT_DIV_NO,count(rr2.X_POLICY_NO) As Div4from RNEWL_RTENTN_DETL RR2 whereRR2.F_BVT_DIV_NO<>RR2.F_DIVISION_NO and month(RR2.X_POLICY_XPRTN_DT)=2 and year(RR2.X_POLICY_XPRTN_DT)=2007 and rr2.F_DIVISION_NO = 4 Group By rr2.F_BVT_DIV_NO ) rr2 on rr2.F_BVT_DIV_NO = rr.F_BVT_DIV_NOfrom TRNEWL_RTENTN_DETL rr3where month(rr3.X_POLICY_XPRTN_DT)=2 andyear(rr3.X_POLICY_XPRTN_DT)=2007Group by rr3.F_DIVISION_NO) rr3 onrr3.F_DIVISION_NO = rr.F_BVT_DIV_NOgroup by rr.F_BVT_DIV_NO,rr3.F_DIVISION_NOorder byrr.F_BVT_DIV_NO
That code is just a little piece of it, but the logic is the same throughout. Thanks for the input!