I know about DATEDIFF (d, date1, date2), but I do not want to subtract two dates, not the number of days from the date.
For instance:
"2010-04-13" - 4 = "2010-04-09"
Is this possible with mySQL?
date_sub (date, interval 4 days);
Yes. See http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_adddate
SELECT DATE_ADD('2008-01-02', 31);
Results in:
'2008-02-02'
To subtract, simply use a negative number or use DATE_SUB
DATE_SUB
2 .
SELECT [Date] ,DATEADD(DAY, -2, [Date]) AS [NewDate] FROM [YourTable]
. Mysql . google mysql datetime functions, .
mysql datetime functions
Source: https://habr.com/ru/post/1740880/More articles:Прочитайте все значения ячеек из диапазона Excel в С# - c#Как скомпилировать исходный код на С++, написанный для Linux/Unix в Windows Vista (данный код) - c++How to access a named control element that inherits from a template control - templatesIf we don’t like this presentation layer, then why do we tolerate it for the behavior layer? - javascriptHow to access a named element of a derived user control in silverlight? - data-bindingGood Wordpress Theme / Plugin for Demonstrating Code Examples and Scripts - phpTypes of work item references in Visual Studio TFS 2010 - visual-studio-2010Clickable LI overlaps links in LI - javascriptNetbeans cannot find Tomcat launch - javaHow to get the integer value of an enumeration? - c #All Articles