-- Mostrar una diferencia de solo fechas
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-10-03 00:00:00', '2017-10-12 00:00:00')
-- Return: 9d 00:00:00
-- Mostrar una diferencia en minutos
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-10-05 07:30:00', '2017-10-05 07:55:00')
-- Return: 0d 00:25:00
-- Mostrar una diferencia en la misma fecha
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-09-01 01:46:00', '2017-09-01 10:55:00')
-- Return: 0d 09:09:00
-- Mostrar una diferencia de dias
SELECT dbo.ufn_DifferenceBetweenDateTimes('2017-11-21 08:21:00', '2017-12-06 18:00:00')
-- Return: 15d 09:39:00