Available Tables

Next →

Date Functions (DATEADD, DATEDIFF, EXTRACT)

SQL includes useful functions to work with dates and times.

Common Date Functions

Example: Find Students Who Joined Over 30 Days Ago

SELECT * FROM students
WHERE DATEDIFF(day, join_date, CURRENT_DATE) > 30;

This finds students whose join_date is more than 30 days before today.

Date functions help analyze timelines, calculate ages, filter date ranges, and more.