On Wednesday 05 December 2001 18:48, Emil Rasmussen wrote:
> > I am not sure I quite understand your problem, but doen't the BETWEEN ...
> > AND operator
> > solve your problem? All you have to do is to format the limits in a way
> > that MySQL understands
> > to be a timestamp, and it should then do a proper date comparison.
>
> Nope, the BETWEEN AND operator does not work either. I would like to know
> how to format the limits, so that MySQL understands that i want the results
> from a particular hour?
>


If your field is a standard MySQL DATE/TIME field then

 HOUR(myfield) will extract the hour portion from myfield.

Thus you can have

 WHERE HOUR(myfield) = 14

will select only those rows in myfield where the time is 2:XX PM.

hth
-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
The Abrams' Principle:
        The shortest distance between two points is off the wall.
*/

---------------------------------------------------------------------
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

Reply via email to