Home >Database >Mysql Tutorial >How to add a day to DATETIME field in MySQL query?
With the help of DATE_ADD() function, we can add a day to the DATETIME field of the table.
mysql> Select StudentName, RegDate, Date_ADD(RegDate, INTERVAL +1 day) AS 'NEXT DAY' from testing where StudentName = 'gaurav'; +-------------+---------------------+---------------------+ | StudentName | RegDate | NEXT DAY | +-------------+---------------------+---------------------+ | Gaurav | 2017-10-29 08:48:33 | 2017-10-30 08:48:33 | +-------------+---------------------+---------------------+ 1 row in set (0.00 sec)
The above query will add a day to the RegDate (where StudentName is Gaurav) in the MySQL table named "testing".
The above is the detailed content of How to add a day to DATETIME field in MySQL query?. For more information, please follow other related articles on the PHP Chinese website!