TheFilmGod Posted February 27, 2010 Share Posted February 27, 2010 SELECT * FROM calendar_events WHERE datetime BETWEEN '2010-01-01 00:00:00' AND '2010-01-31 23:59:59' A very very very basic SELECT statement that doesn't seem to work. This is part 1 of a complicated JOIN I am doing. But since this doesn't seem to pull up any records from the database, the complicated JOIN will not work. Thanks for your help! Quote Link to comment https://forums.phpfreaks.com/topic/193601-query-range-of-dates-in-mysql/ Share on other sites More sharing options...
PFMaBiSmAd Posted February 27, 2010 Share Posted February 27, 2010 There is nothing technically wrong with that query. It would take seeing an example of data in the datetime column that you expect to be returned and what the column definition is for anyone to have a chance at telling you why nothing is being returned. Also, how did you execute this query and display the results or otherwise determine that there were no matching rows returned? Edit: Also how is the query being produced, because something like a non-printing character, such as a newline or a null, as part of the '2010-01-01 00:00:00' ... values would prevent a match. Quote Link to comment https://forums.phpfreaks.com/topic/193601-query-range-of-dates-in-mysql/#findComment-1019140 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.