The DATEDIFF function is used to calculate the difference between two date in SQL Server. The syntax is given below DATEDIFF (datepart, expression1, expression2) <expression1> and <expression2> is some date, time, or datetime. datepart abbreviation year yy, yyyy quarter qq, q month mm, m dayofyear dy, y day dd, d week wk, ww hour hh minute mi, n second ss, s millisecond ms microsecond mcs nanosecond ns TZoffset tz ISO_WEEK isowk, isoww Example: Query: SELECT DATEDIFF ( day , '2012-09-18' , '2012-09-28' ); OUTPUT:10