|
| |
| 1. | DATEDIFF: return the difference between two dates | | | | 2. | Find the number of days between 24th March 2001 and 24th March 1964 | | | | 3. | DATEDIFF(yyyy, "24 March 2001","24 March 1964") | | | | 4. | DATEDIFF(mi, "24 March 2001","24 March 1964") | | | | 5. | DATEDIFF(wk, "24 March 2001","24 March 1964") | | | | 6. | DATEDIFF(m, "24 March 2001","24 March 1964") | | | | 7. | DATEDIFF(d, @thisdate, @nextmonth) 'Days between' | | | | 8. | DATEDIFF(month, '9-8-1989', '10-17-1991') | | | | 9. | DATEDIFF(day, '9-8-1989', '10-17-1991') | | | | 10. | Difference in weeks between 7-2-1996 and 8-4-1997 | | | | 11. | DATEDIFF(ss, @MyBirthDate, GETDATE()) | | | | 12. | Difference between the current time and UTC | | | | 13. | DATEDIFF: date difference | | | | 14. | Combine DateADD and DateDIFF to get the last date of a month | | | | 15. | Passing a column name to the DATEDIFF() value argument | | |
|