Employees Table In this example, we want to find out how many days an employee has been working for the organization since their hire date. Syntax DATEPART Reference Table Example Results (Query ran on 12/13/2011) The SQL DATEDIFF function can be very useful when you are interested in finding out how much time there is between two dates, a date, and a date field, or two date fields.