Beginner

219. Date Addition

Learn how to add days, months, or other intervals to date values.

📘 Lesson 219 of 728 ⏱ 9 min 🎯 Intermediate

Date addition allows a date or timestamp to be moved forward by a specified number of days, months, years, or another supported interval.

Business processes often depend on calculated future dates such as due dates, expiry dates, review dates, and payment dates.

Calculate a payment due date 30 days after an invoice date.

SQL
SELECT
    InvoiceID,
    InvoiceDate,
    InvoiceDate + INTERVAL '30' DAY AS DueDate
FROM Invoices;

Date addition is useful for loan schedules, payment deadlines, subscriptions, employee reviews, warranties, and compliance monitoring.

  • Date addition moves a date forward.
  • Days, months, and years can be added.
  • Syntax varies significantly between databases.
  • It is useful for due-date calculations.
  • Date arithmetic should consider calendar behavior.
Why add intervals to dates?

Date intervals are used to calculate future dates such as deadlines, expiry dates, and review dates.

Is date-addition syntax identical across databases?

No. Different database systems use different date arithmetic functions and syntax.

Have you finished this lesson?

Introduction to SQL – All Lessons