datediff

Determines the difference between two datetime expressions and returns an integer result in "datepart" units. "Datepart" refers to a year, month, day, hour, minute, or second. "Datetime_expression1" and "datetime_expression2" can be dates, times, or timestamps.

Syntax

datediff ( { datepart } , datetime_expression1, datetime_expression2 )