If you ever need to query for a date range on a date column, try the following example.


/* All records that are within a week */

SELECT * FROM <table_name> WHERE <some_date_column> BETWEEN DATE_SUB(NOW(), INTERVAL 7 DAY) AND NOW();

/* All records within the last 2 hours */

SELECT * FROM <table_name> WHERE <some_date_column> BETWEEN DATE_SUB(NOW(), INTERVAL 2 HOUR) AND NOW();