DATE_SUB() Function in MySQL

The DATE_SUB() Function in MySQL allows for various date and time calculations by subtracting time intervals. It is used to subtract a specified time or date interval from a given date and then return the resulting date.

MySQL DATE_SUB() Function

The MySQL DATE_SUB() function subtracts a specified time or date interval from a datetime value.

Similar Reads

DATE_SUB() Function in MySQL

The DATE_SUB() Function in MySQL allows for various date and time calculations by subtracting time intervals. It is used to subtract a specified time or date interval from a given date and then return the resulting date....

Syntax

MySQL DATE_SUB() function syntax is:...

MySQL DATE_SUB() Function Example

Let us look at some examples of the DATE_SUB function in MySQL . Learning MySQL DATE_SUB() function with examples will help in understanding it better....

Important Points About MySQL DATE_SUB() Function

The MySQL DATE_SUB() function is used to subtract a specified time or date interval from a given date and then returns the resulting date. The DATE_SUB() function is useful for performing date arithmetic, calculating past datetime values, and tracking durations. The function can be used with both date and datetime values. Related functions include DATE(), LAST_DAY(), DATE_FORMAT(), DATE_ADD(), and DATEDIFF()....