SUBDATE(, ) allows you to subtract a specified number of days from a date: : SUBDATE « Date Time « SQL / MySQL






SUBDATE(, ) allows you to subtract a specified number of days from a date:

   
mysql>
mysql>
mysql> SELECT SUBDATE('2004-12-31 23:59:59', 31);
+------------------------------------+
| SUBDATE('2004-12-31 23:59:59', 31) |
+------------------------------------+
| 2004-11-30 23:59:59                |
+------------------------------------+
1 row in set (0.00 sec)

   
    
    
  








Related examples in the same category

1.Subtract from a date by using the SUBDATE() or DATE_SUB() functions: SUBDATE(, INTERVAL