
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Add 11 days to current date in MySQL
Let us first create a table −
mysql> create table DemoTable1994 ( ArrivalDate date ); Query OK, 0 rows affected (5.33 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1994 values('2019-12-18'); Query OK, 1 row affected (0.47 sec) mysql> insert into DemoTable1994 values('2019-12-19'); Query OK, 1 row affected (0.33 sec) mysql> insert into DemoTable1994 values('2019-12-20'); Query OK, 1 row affected (0.49 sec) mysql> insert into DemoTable1994 values('2019-12-25'); Query OK, 1 row affected (0.30 sec) mysql> insert into DemoTable1994 values('2018-12-20'); Query OK, 1 row affected (1.42 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1994;
This will produce the following output −
+-------------+ | ArrivalDate | +-------------+ | 2019-12-18 | | 2019-12-19 | | 2019-12-20 | | 2019-12-25 | | 2018-12-20 | +-------------+ 5 rows in set (0.00 sec)
Here is the query to add 11 days to current date MySQL −
mysql> select ArrivalDate,date_add(ArrivalDate,interval 11 Day) from DemoTable1994 where ArrivalDate=curdate();
This will produce the following output −
+-------------+---------------------------------------+ | ArrivalDate | date_add(ArrivalDate,interval 11 Day) | +-------------+---------------------------------------+ | 2019-12-20 | 2019-12-31 | +-------------+---------------------------------------+ 1 row in set (0.00 sec)
- Related Articles
- MySQL add days to a date?
- C# DateTime to add days to the current date
- Java Program to add days to current date using Java Calendar
- Add 30 days to date in a MySQL table with arrival date records
- How to add current date to an existing MySQL table?
- Fetch records from interval of past 3 days from current date in MySQL and add the corresponding records
- How to add days to $Date in PHP?
- Add some months to current date using Java with MySQL?
- MySQL query to fetch date records greater than the current date after adding days with INTERVAL?
- MySQL Datetime to add days?
- Fetch student records whose result declared 12 days before the current date in MYSQL
- How to get the records of the last two days from the current date in MySQL?
- How to add number of days to JavaScript Date?
- Subtract days from current date using Calendar.DATE in Java
- Get the number of days between current date and date field?

Advertisements