I need to add two columns which stores time values as decimals example: 1.) 8.30+0.32 = 9.02 (output should be 9.03 not 8.62)
The above mentioned example is working fine and is an actual output of the below SQL.
I wrote the below SQL which works fine predominantly, but I find few cases where the addition is not proper
Example: 3.57+5.25=18.44
SELECT
case when B.Column_B is null then A.Column_A
when B.Column_B is not null then
replace(CONVERT(varchar(5),
DATEADD(ss,(SUM((DATEPART(hh, replace(isnull(a.Column_A,0.00),'.',':'))*3600) + (DATEPART(mi,replace(isnull(a.Column_A,0.00),'.',':'))*60)) +
SUM((DATEPART(hh, replace(isnull(b.Column_B,0.00),'.',':'))*3600) + (DATEPART(mi,replace(isnull(b.Column_B,0.00),'.',':'))*60))),0),108) ,':','.')
End as "Total_Hours"
I am not able to find where this is going wrong in the above mentioned case. Is there anything wrong here or is there any better way of handling this addition