bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL ADDDATE() Function

Flash cards

Review the key moves

1/4
Core idea

What is the main idea behind MySQL ADDDATE() 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.

___ ADDDATE("2017-06-15", INTERVAL 10 DAY);
3Order

Put the learning moves in the order that makes the concept easiest to apply.

The ADDDATE() function adds a time/date interval to a date and then returns the date.
Definition and Usage
MySQL ADDDATE() Function

Example

SELECT ADDDATE("2017-06-15", INTERVAL 10 DAY);

Definition and Usage

The ADDDATE() function adds a time/date interval to a date and then returns the date.

Syntax

ADDDATE(
date
, INTERVAL
value addunit
)

OR

ADDDATE(
date
,
days
)

Parameter Values

ParameterDescription
dateRequired. The date to be modified
daysRequired. The number of days to add to date
valueRequired. The value of the time/date interval to add. Both positive and negative values are allowed
addunitRequired. 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

Previous

MySQL TRUNCATE() Function

Next

MySQL ADDTIME() Function