/*--Google Analytics--*/ /*--Google Analytics--*/

Difference Between Current Date & Given Date: Sql Server Query

SELECT DATEDIFF(day, GETDATE(), '2010-10-03');
or
SELECT DATEDIFF(day, GETDATE(), '2010-10-03 00:00:00.0000000');

Here the GETDATE() is the built-in function of the SQL SERVER which returns the Current Date Time.

0 comments:

Post a Comment