select ‘Yıl Farkı’, datediff(yyyy, ‘2005-01-22 10:20:00′, ‘2008-01-22 16:20:00′)
Sonuç=> 3
select ‘Ay Farkı’, datediff(m, ‘2008-01-22 10:20:00′, ‘2008-12-22 16:20:00′)
Sonuç=>11
select ‘Gün Farkı’, datediff(d, ‘2008-01-22 10:20:00′, ‘2008-01-29 16:20:00′)
Sonuç=> 7
select ‘Saat Farkı’, datediff(hh, ‘2008-01-22 10:20:00′, ‘2008-01-22 16:20:00′)
Sonuç=> 6
select ‘Dakika Farkı’, datediff(mi, ‘2008-01-22 10:20:00′, ‘2008-01-22 16:20:00′)
Sonuç=> 360
select ‘Saniye Farkı’, datediff(s, ‘2008-01-22 10:20:00′, ‘2008-01-22 10:20:30′)
Sonuç=> 30
Hiç yorum yok:
Yorum Gönder