I have a conversion method to accomplish converting a datediff() to dd:hh but i am also trying to add some additional calculations into it which is causing an arithmetic overflow error converting numeric to varchar.
im not looking for anyone to solve my arithmetic issue, just looking for alternate conversion methods that i can try out and test for myself, if this is pointless please tell me as well, not sure if a different method will change anything.
here is the current method:
-- resulting in Days
convert(varchar(10), (datediff(second, startdate, enddate)/86400)+':'+
-- resulting in hours
convert(varhcar(10), (datediff(second, startdate, enddate)%86400/3600)) as 'DD:HH'
does anyone have anything else that will accomplish the same goal?
maybe a better way to ask is there a way to limit the arithmetic performed in this to return a shorter integer so that i can work towards avoiding the overflow error?
thanks to @rahultripathi for this link for datetime conversions in SQL, gave me what i needed.
Click Here for Link
will update answer with more info ASAP, havent figure everything out yet, if someone has a better answer, I will accept it