1> -- DATEDIFF() Function
2>
3> --There are four elements in this equation: the start date, the interval (date unit),
4> -- the difference value, and the end date.
5>
6> -- What the difference is between the dates 9-8-1989 and 10-17-1991 in months:
7>
8> SELECT DATEDIFF(month, '9-8-1989', '10-17-1991')
9> GO
-----------
25
(1 rows affected)
1>
2>
|