MySQL Function Reference
MySQL DATE_ADD() Function
Learn how to use the MySQL DATE_ADD date function with practical examples and cross-dialect alternatives.
Syntax
DATE_ADD(date, INTERVAL expr unit)
DATE_ADD adds a time interval to a date or datetime and returns the adjusted value.
Basic Example
SELECT DATE_ADD('2026-05-17', INTERVAL 7 DAY) AS plus_7_days;
-- Result: 2026-05-24
Practical query example
SELECT order_id,
order_date,
DATE_ADD(order_date, INTERVAL 30 DAY) AS due_date
FROM orders;
Useful interval units
SELECT DATE_ADD('2026-05-17 09:30:00', INTERVAL 90 MINUTE) AS plus_90_minutes,
DATE_ADD('2026-05-17', INTERVAL 2 MONTH) AS plus_2_months,
DATE_ADD('2026-05-17', INTERVAL 1 YEAR) AS plus_1_year;
When to use it
Use DATE_ADD for due dates, renewal dates, retention windows, and schedule offsets in MySQL reports and transactional queries.
Common mistakes
- Forgetting the
INTERVALkeyword before the value and unit. - Using a unit name that MySQL does not support for the expression.
- Using DATE_ADD when you meant subtraction. Use DATE_SUB for that case.
Cross-dialect alternatives
- PostgreSQL:
date_col + INTERVAL '7 days' - SQL Server:
DATEADD(day, 7, date_col) - Oracle:
date_col + INTERVAL '7' DAY
Related SQL Functions
FAQ
Can DATE_ADD add months and years?
Yes. You can use units like MONTH and YEAR with the INTERVAL clause.
Can I subtract using DATE_ADD?
You can pass a negative interval, but most teams prefer DATE_SUB for readability.
Does DATE_ADD work with datetime values?
Yes. It works with DATE, DATETIME, and TIMESTAMP values and returns the adjusted result.