spires Posted March 2, 2007 Share Posted March 2, 2007 Hi, Does anyone know if there is a function that allows me to select the time out a database, between selected times? For Example: select all between 10.00 and 2.00 select all between 8.00 and 16.00 select all between 1.00 and 24.00 Thanks for any help Link to comment https://forums.phpfreaks.com/topic/40940-select-between-1030-and-230/ Share on other sites More sharing options...
utexas_pjm Posted March 3, 2007 Share Posted March 3, 2007 Try this: SELECT * FROM `your_table` WHERE HOUR(`date_column`) BETWEEN 10 AND 2; SELECT * FROM `your_table` WHERE HOUR(`date_column`) BETWEEN 8 AND 16; SELECT * FROM `your_table` WHERE HOUR(`date_column`) BETWEEN 1 AND 24; Best, Patrick Link to comment https://forums.phpfreaks.com/topic/40940-select-between-1030-and-230/#findComment-198298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.