Get sub date : Date Function « Date Time « SQL / MySQL






Get sub date

 
/*
mysql> SELECT DATE_SUB(CURDATE(),INTERVAL 1 DAY);
+------------------------------------+
| DATE_SUB(CURDATE(),INTERVAL 1 DAY) |
+------------------------------------+
| 2005-10-08                         |
+------------------------------------+
1 row in set (0.00 sec)


*/  
SELECT DATE_SUB(CURDATE(),INTERVAL 1 DAY);

           
         
  








Related examples in the same category

1.Date data type manipulation
2.Get Day of Month for a date
3.Get the YEAR part of the date
4.Birthdays in the upcoming month
5.DATE_ADD() add a time interval to a given date
6.Calculation on Date data type
7.Date Calculations: calculate ages
8.Date Calculations: extract parts of dates
9.Decomposing Dates or Times Using String Functions substrings.
10.Pull out the entire date or time part from DATETIME values using string-extraction functions such as LEFT( ) o