DECLARE @ilktar datetime = '2010-01-01 08:15:00.0',
@sontar datetime = '2011-08-17 19:00:35.0'
SELECT
DATEDIFF(YEAR,@ilktar,@sontar) AS [Yıl]
,DATEDIFF(MONTH,@ilktar,@sontar) AS [Ay]
,DATEDIFF(WEEK,@ilktar,@sontar) AS [Hafta]
,DATEDIFF(DAY,@ilktar,@sontar) AS [Gün]
,DATEDIFF(HOUR,@ilktar,@sontar) AS [Saat]
,DATEDIFF(MINUTE,@ilktar,@sontar) AS [Dakika]
,DATEDIFF(SECOND,@ilktar,@sontar) AS [Saniye]
Kaynak : http://msdn.microsoft.com/en-us/library/ms189794.aspx
Hiç yorum yok:
Yorum Gönder