I have this part of a query:
CONVERT(VARCHAR, DATEDIFF(dd, t.startdate,SYSDATETIME())) + '':'' +
CONVERT(VARCHAR, DATEDIFF(hh, t.startdate,SYSDATETIME()) % 24) + '':'' +
CONVERT(VARCHAR, DATEDIFF(mi, t.startdate,SYSDATETIME()) % 60) as Days
which translates to this:
What I want to do is, if there is a single value, for example in 15:9:40, such as 9, I want to put 0 in front of 9, to look something like 15:09:40.
Any idea how can I solve that within the query?