Use TIME_FORMAT in mysql query to fetch records..

SELECT * FROM TABLE_NAME
WHERE TIME_FORMAT( time, "%h:%i %p" ) > "12:00 am"
AND TIME_FORMAT( time, "%h:%i %p" ) < "7:00 pm"


Set the format as per your requirement...

http://dev.mysql.com/doc/refman/5.1/en/date-and-time-functions.html#function_time-format
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to