Given two date/times:
@start_date = \'2009-04-15 10:24:00.000\'
@end_date = \'2009-04-16 19:43:01.000\'
Is it possible to calculate the tim
DATEDIFF can return unintuitive values. For example, the two dates below differ by one second yet DATEDIFF with the parameters below and interpreted as others have interpreted it above returns 1 year:
SELECT DATEDIFF(year, '2005-12-31 23:59:59', '2006-01-01 00:00:00')
Look at the MSDN documentation for DATEDIFF to understand how it works.