Flash cards
Review the key moves
1/4
Core idea
What is the main idea behind MySQL DATE_ADD() Function?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
1Quick choice
Which statement best captures the main point of this lesson?
2Fill blank
Complete the missing token from the example code.
___ DATE_ADD("2017-06-15", INTERVAL 10 DAY);3Order
Put the learning moves in the order that makes the concept easiest to apply.
The DATE_ADD() function adds a time/date interval to a date and then returns the date.
Definition and Usage
MySQL DATE_ADD() Function
Example
SELECT DATE_ADD("2017-06-15", INTERVAL 10 DAY);Definition and Usage
The DATE_ADD() function adds a time/date interval to a date and then returns the date.
Syntax
DATE_ADD(
date
, INTERVAL
value addunit
)Parameter Values
| Parameter | Description |
|---|---|
| date | Required. The date to be modified |
| value | Required. The value of the time/date interval to add. Both positive and negative values are allowed |
| addunit | Required. The type of interval to add. Can be one of the following values: MICROSECOND SECOND MINUTE HOUR DAY WEEK MONTH QUARTER YEAR SECOND_MICROSECOND MINUTE_MICROSECOND MINUTE_SECOND HOUR_MICROSECOND HOUR_SECOND HOUR_MINUTE DAY_MICROSECOND DAY_SECOND DAY_MINUTE DAY_HOUR YEAR_MONTH |
- MICROSECOND
- SECOND
- MINUTE
- HOUR
- DAY
- WEEK
- MONTH
- QUARTER
- YEAR
- SECOND_MICROSECOND
- MINUTE_MICROSECOND
- MINUTE_SECOND
- HOUR_MICROSECOND
- HOUR_SECOND
- HOUR_MINUTE
- DAY_MICROSECOND
- DAY_SECOND
- DAY_MINUTE
- DAY_HOUR
- YEAR_MONTH
Technical Details
| Works in: | From MySQL 4.0 |
|---|