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 Comments »
RSS feed for comments on this post. TrackBack URL
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!
Play this site, really appreciate it.
I like the theme of your blog! Job well done
I love this site, so thank you