Hello Peter,

Wednesday, March 10, 2004, 12:16:51 AM, you wrote:

PB> But that is adding two days, the original query was to add two
PB> months, so presumably it should be "INTERVAL 2 MONTH" - but beware
PB> that MySQL does some

It should, sorry, I'm too used to the UK date format (even though I
know MySQL doesn't use it) but you get the idea anyway.

PB> seriously bizarre things with dates - for example adding 2 months
PB> to 31st Dec takes you to 31st Feb which probably isn't what you
PB> want.

Doesn't for me:

SELECT DATE_ADD('2004-12-31 00:00:00', INTERVAL 2 MONTH)

Gives me "2005-02-28 00:00:00", which is what I would expect. That's
on MySQL 3.23.58, so I doubt if they "broke" it in any version since.

MySQLs date handling has never caused any problems for me (when I
remember the correct y-m-d format :)

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to