* Tom Jones > I have a table with 2 columns StartDate and EndDate. > > I can't seem to figure out how to write a select statement that will > tell me if the date I'm searching on is between the Start and the End > date. > > Like, I want to know if 7/4/2002 is between 6/1/2002 (startDate) and > 8/1/2002 (endDate).
Take a look at the BETWEEN operator: <URL: http://www.mysql.com/doc/C/o/Comparison_Operators.html > Something like this: SELECT * FROM MyTable WHERE '2002-07-04' BETWEEN startDate AND endDate; -- Roger --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php