Developers Heaven Forum

DataBase => SQL Server => Topic started by: admin on January 02, 2009, 11:38:15 AM

Title: difference between two dates
Post by: admin on January 02, 2009, 11:38:15 AM
1> -- DATEDIFF: return the difference between two dates.
2>
3> -- DATEDIFF(what_to_return,first_date,second_date)
4>
5> -- Return the number of days between 24th March 1964 and 2001, you would use,
6>
7> SELECT DATEDIFF(dd,"24 March 1964","24 March 2001")
8> GO

-----------
      13514

(1 rows affected)
1>