Ya I ran them from the command line and they all work except for when I do the EDIT_LOCK + INTERVAL 10 MINUTE. It actually returns NULL. Very Strange.
-Steve. -----Original Message----- From: Benjamin Pflugmann [mailto:[EMAIL PROTECTED]] Sent: Monday, July 29, 2002 4:13 PM To: Steve Bradwell Cc: [EMAIL PROTECTED] Subject: Re: DATE INTERVAL question. Hi. On Mon 2002-07-29 at 11:35:03 -0400, [EMAIL PROTECTED] wrote: > > I am trying to run a query that will check to see if a time field is less > than the the time in the field plus ten minutes. This does not make sense. This will always be true: A < A + 10 <=> 0 < 10 <=> true > The field must also be greater than 00:00:00. The query below > executes without error but doesn't return rows. Can I do this or is > there a better way. I'm using MySQL in conjunction with PHP. > > SELECT EDIT_LOCK FROM ordmaster WHERE ORDER_NO = '5' AND EDIT_LOCK > 0 AND > EDIT_LOCK < EDIT_LOCK + INTERVAL 10 MINUTE; Well, does SELECT EDIT_LOCK FROM ordmaster WHERE ORDER_NO = '5' return any rows? What about SELECT EDIT_LOCK FROM ordmaster WHERE ORDER_NO = '5' AND EDIT_LOCK > 0 "EDIT_LOCK > 0" should work as expected. The rest should resolve to true, so I do not see any reason why you do not get the desired result. Exclude PHP from the equation, i.e. run the query in the mysql command line client. Greetings, Benjamin. -- [EMAIL PROTECTED] --------------------------------------------------------------------- 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