Mar
13
2006

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 ;)

Written by Aaron Wormus in: Cookbook, MySQL |

4 Comments »

  • 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!

    Comment | 13/3/2006
  • california company

    Play this site, really appreciate it.

    Comment | 24/2/2007
  • I like the theme of your blog! Job well done

    Comment | 16/3/2008
  • kasino

    I love this site, so thank you

    Comment | 22/5/2008

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress | Aeros Theme | TheBuckmaker.com WordPress Themes