himy sample code:create table temp (person varchar(10),department int,hours float)-- drop table tempinsert into tempselect 'A',11, 11.23 union allselect 'A',12, 23.21 union allselect 'A',13, 32.10 union allselect 'B',11, 34.1 union allselect 'B',12, 20 union allselect 'B',13, 21.10 union allselect 'C',11, 24select person,(selectsum(hours) from temp as t2where t1.person = t2.person) as total,hours,department,(hours/(selectsum(hours) from temp as t2where t1.person = t2.person)) as share from temp as t1
i want to get "share" round up on two decimals format "0,24" that sums per person will add = 1i can't get it right, using round, cast and convert :)it should be a simple solution, i just do not see it :)thank you for your help.