select a.[Compte ],a.[AC_CCY ],a.[related_customer], sum(case when [DRCR_IND]!=\'C\' then 0 else 1*(cast([FCY_AMOUNT] as float) end) as Fcy_amount_C ,sum(case when [DRCR_IND]!=\