Mar 28, 2019 02:01 PM|PatriceSc|LINK
You are using 15.20 for 15 hours 20 minutes but doesn't do any transformation on this value. Also use functions to solve a small problem and then move to the next rather than ending up in building a single complex and error prone expression.
SELECT 40*60-(15*60+20) -- 1480 minutes
SELECT 1480/60 -- 24 hours
SELECT 1480%60 -- 40 minutes left
Actually I would move away from this design to keep basic calculation on the db side and formatting the duration as I want on the client side.
Edit: my understanding is that you never handle seconds but go down only to the minute.