SQL Function Reference

DATEDIFF
Returns the difference in days between dates. When calculating the difference, the date is used, the time is not used
MySQL
DATEDIFF(datetime1, datetime2)
Examples
MySQL
SELECT DATEDIFF('2022-12-05','2022-12-01')