I am trying to get cumulative DATEDIFF but am coming up with not exactly what I need.
This is the code that I am using
CONVERT(VARCHAR(30),DATEDIFF(dd,i.MODIFY_DATE,GETDATE()),121) + 'D ' +
CONVERT(VARCHAR(30),DATEDIFF(hh,i.MODIFY_DATE,GETDATE()),121) + 'H ' +
CONVERT(VARCHAR(30),DATEDIFF(dd,i.MODIFY_DATE,GETDATE()),121) + 'M '
the i.MODIFY_DATE = 2013-10-09 12:37:54.663
current get date = 2014-10-07 12:31:52.993
The output that I get is = 363D 8712H 363M
What I am looking for is so that the H don't go over 24 and the M doesn't go over 60. Meaning something where it takes every 60M and adds 1 to H, and the same with H but every 24 it adds to D