bugl
bugl
HomeLearnPatternsPathsSearch
HomeLearnPatternsPathsSearch

Loading lesson path

Learn/SQL/SQL References
SQL•SQL References

MySQL DATEDIFF() Function

Flash cards

Review the key moves

1/4
Core idea

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

___ DATEDIFF("2017-06-25", "2017-06-15");
3Order

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

The DATEDIFF() function returns the number of days between two date values.
Definition and Usage
MySQL DATEDIFF() Function

Example

SELECT DATEDIFF("2017-06-25", "2017-06-15");

Definition and Usage

The DATEDIFF() function returns the number of days between two date values.

Syntax

DATEDIFF(
date1
,
date2
)

Parameter Values

ParameterDescription
date1, date2Required. Two dates to calculate the number of days between. (date1 - date2)

Technical Details

Works in:From MySQL 4.0

Previous

MySQL DATE() Function

Next

MySQL DATE_ADD() Function