DateDiff function in SQL Server

March 17, 2009 at 3:13 pm (SQL, Technical, Tips and Tricks) (, )

I frequently used to calculate date difference between two dates. I use to open the calendar and calculate the difference. But now I have found a easier way to calculate the date difference using the SQL DateDiff function

DateDiff returns the number of date and time boundaries crossed between two dates.

Syntax:

DateDiff(datepart, startdate, enddate)

Read the rest of this entry »

Permalink 4 Comments