Lord Kelvan wrote:
> On May 22, 4:19 pm, "J.O. Aho" <u...@example.net> wrote:
>> One of the following should do what you need:
>>
>> PERIOD_ADD(P,N)
>> ADDDATE(date,INTERVAL expr unit)
>> ADDDATE(expr,days)
>>
>> http://dev.mysql.com/doc/refman/5.0/...nctions.html#f...
> thoes functions are good but they are for future dates not prior dates
> i have the current date and basically i need a dynamic sql script to
> take todays date and count back 1 year and get that date
mysql> select ADDDATE(CURRENT_DATE(),INTERVAL -31 DAY);
+------------------------------------------+
| ADDDATE(CURRENT_DATE(),INTERVAL -31 DAY) |
+------------------------------------------+
| 2007-04-21 |
+------------------------------------------+
1 row in set (0.00 sec)
--
//Aho