Thanks guys,

Thats the same mistake i made weeks ago, you'd think i'd learn.

thanks again.

Ricardo.

Rob Mclennan wrote:
Ricardo

Think you are misreading the dates

Your SQL is checking if 17.00 is between 17.05 and 17.30 or 17 59 is
between 17.00 and 17.30

Rob


-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ricardo Russon Sent: Monday, 28 June 2004 1:29 PM To: CFAussie Mailing List Subject: [cfaussie] Re: SQL Problem


Ayudh

I would have thought that in the second one both would have matched?

Where 5:05 between 5:00 And 5:59
OR 5:30 between 5:00 And 5:59

??

Am i misunderstanding this function? How would i structure the query so
that i could match on all three times?

TIA.
Ricardo.


Ricardo,
Your query is returning the right results in all of your 3 cases as far as I can see. Case 1 matches because the 1st clause is satisfied. Case 2 does not match because neither clause is satisfied. Case 3 matches because the 2nd clause is satisfied.


Regards: Ayudh

+----------------------------------------------------------------+
| SOAP is the glue! Hook up your server directly to your bank.   |
| Connect to VeriPay xServ, the Australian Payments Web Service. |
| Reliable, Secure, FAST: http://www.xilo.com/xserv              |
+----------------------------------------------------------------+



Hi guys,
Can anyone tell me where i went wrong?
I can't seem to match the time if they are both within the same hour. unless the time is on the O'clock.


SELECT * FROM diary
WHERE (({ts '2004-06-28 17:00:00'} BETWEEN date AND finishTime) OR ({ts '2004-06-28 17:59:00'} BETWEEN date AND finishTime )) AND cid = 72


date / finishTime
28/06/2004 5:00:00 PM    28/06/2004 5:30:00 PM - match
28/06/2004 5:05:00 PM    28/06/2004 5:30:00 PM - no match
28/06/2004 5:05:00 PM    28/06/2004 6:30:00 PM - match

I'm using MySQL 4.1.1
TIA
Ricardo.









---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to
[EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/




--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to