MySQL SELECT FROM range of dates
Written by Guillermo Garron
Date: 2015-01-11 16:05:20 00:00
How to Select rows from a range of dates with MySQL query command
If you need to select rows from a MySQL database' table in a date range, you need to use a command like this:
SELECT * FROM table WHERE date_column >= '2014-01-01' AND date_column <= '2015-01-01';
Of course you need to change:
- table
- date_column
To meet your needs.
Another way is to use this command
SELECT * FROM table WHERE date_column BETWEEN '2014-01-10' AND '2015-01-01';
Once again, change the table and date_column to meet your data.