sql date diff with date format code example Example: date diff sql SELECT DATEDIFF(year, '2017/08/25', '2011/08/25') AS DateDiff;