How to select the matching details from table mysql query equal to current date

Hi…,

my question is how can i select the row in a particular given time span.

i.e if my date field is having the entry as 2010:10:27 10:30:00 then that row should be selected when the current time reaches 2010:10:27 10:00 and until the current time reaches the  2010:10:27 18:30:00 . like that. Any help on this would do a great benefits for me..

thanks in advance

Thread moved to MySQL forum

let me see if i understand your requirements…

you want the query to return 10:30 but only between 10:00 and 18:30?

i’m sorry, i don’t understand

You can use now(), to get the current datetime
and the function date_add() to add to datetimes.

e.g. maybe something like

where date_field between 
date_add(now(), interval 30 minute)
 and
date_add(now(), interval 8 hour)
;