INTERVAL quirkyness

MySQL date and time commands annoy me almost as much as the MySQL online manual. I’m moving my office so my MySQL reference manual was in some box… and I had to resort to digging through the manual.

I don’t know why I always have a hard time remembering

SELECT DATE_SUB( NOW( ) , INTERVAL 7 DAY );

2006-03-06 17:03:21

SELECT NOW( ) - INTERVAL 7 DAY;

2006-03-06 17:06:54

I’m not sure what confused me… maybe the fact that I was trying to do INTERVAL 1 WEEK ;)

4 Responses to “INTERVAL quirkyness”

  1. Aaron Wormus Says:

    Well, the manual page says that I should be able to do 1 WEEK… of course that is probably in MySQL 5 only… like I said, the manual sucks!

  2. california company Says:

    Play this site, really appreciate it.

  3. Interval Says:

    I like the theme of your blog! Job well done

  4. kasino Says:

    I love this site, so thank you

Leave a Reply