DECLARE @TakeOrder DATETIME;
DECLARE @ProcessOrder DATETIME;
-- Time of the ARTICLE created
SET @TakeOrder = '11 Nov 2015 10:05:07';
-- Simulation of NOW datetime
-- (in real world you would probably use GETDATE())
SET @ProcessOrder = '11 Nov 2015 10:07:07';
-- Created 9 days ago.
SELECT 'Diff ' + CAST(DATEDIFF(day, @TakeOrder, @ProcessOrder ) AS NVARCHAR(50)) + ' days ago.' as diff_by_day;
-- Created 1 weeks, 2 days, 3 hours, 25 minutes and 20 seconds ago.
SELECT 'Diff '
+ CAST(DATEDIFF(second, @TakeOrder, @ProcessOrder ) / 60 / 60 / 24 / 7 AS NVARCHAR(50)) + ' weeks, '
+ CAST(DATEDIFF(second, @TakeOrder, @ProcessOrder ) / 60 / 60 / 24 % 7 AS NVARCHAR(50)) + ' days, '
+ CAST(DATEDIFF(second, @TakeOrder, @ProcessOrder ) / 60 / 60 % 24 AS NVARCHAR(50)) + ' hours, '
+ CAST(DATEDIFF(second, @TakeOrder, @ProcessOrder ) / 60 % 60 AS NVARCHAR(50)) + ' minutes and '
+ CAST(DATEDIFF(second, @TakeOrder, @ProcessOrder ) % 60 AS NVARCHAR(50)) + ' seconds ago.' as Difference_by_hole;