SELECT MySQL rows where today's date is between two DATE columns
mysql, select
Solution
You will find a lot of people using between operator, but I prefer using a simple AND operator.
I do that because although the between operator IS inclusive, simple dates (2012-04-10) can be counted as being midnight, and will thus not be inclusive.
So this should work just fine and will always include the boundaries of the date range:
SELECT * FROM table WHERE from_date <= '2012-04-10' AND to_date >= '2012-04-10'
Problem
How can I get the rows in a table where today's date is between (inclusive) two DATE columns of that row? For example, take these two columns of a table: How could I get the first and second rows on the 10th of April, or the 3rd row on the 25th (inclusive, like I said)? Any help would be greatly appreciated. Thanks in advance!