Jump to content


data with type "DATE"~~ QUESTION ABOUT comparing date!!

  • Please log in to reply
1 reply to this topic

#1 mei_913

  • New Members
  • Pip
  • Newbie
  • 6 posts

Posted 01 August 2006 - 02:17 PM

HI everyone! I have a problem with finding date within a range.
In my database, there's a table with a field "updatedate", which is of date type.
I want to find out the record with an "updatedate" within a range (typed by user), but i do not know the syntax for comparing date (YYYY-MM-DD). I've tried ">=" and "<=" but in vain.
Can anyone help me?? Thanks a lot!!!

#2 fenway

  • Staff Alumni
  • MySQL Si-Fu / PHP Resident Alien
  • 16,199 posts
  • LocationToronto, ON

Posted 02 August 2006 - 02:39 PM

It's no different that comparing to string literals... but personally, I prefer using BETWEEN() because it's much more obvious what you're doing.
Seriously... if people don't start reading this before posting, I'm going to consider not answering at all.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users