MySQL:- Fetch records from 31 to 60 days

MySQL

I have a table with a field called date_created with TIMESTAMP format now I have a requirement to fetch records between 0-30,31-60,61-90 like this.
I able to fetch record between months like

SELECT  received_quantity , delivery_qty , unit_cost
FROM    tbl_inward_list
WHERE   date_created BETWEEN NOW() - INTERVAL 30 DAY AND NOW()

also

SELECT  received_quantity , delivery_qty , unit_cost
FROM    tbl_inward_list
WHERE   date_created BETWEEN DATE_SUB( CURDATE( ) ,INTERVAL 2 MONTH ) AND DATE_SUB( CURDATE() ,INTERVAL 1 MONTH )

But I want a query between 31 to 60 also 61 to 90 like this way.

Best Answer

Try this :

SELECT  received_quantity , delivery_qty , unit_cost
FROM    tbl_inward_list
WHERE   datediff(current_date,date(date_created)) BETWEEN  31 AND 60;

Similarly

SELECT  received_quantity , delivery_qty , unit_cost
FROM    tbl_inward_list
WHERE   datediff(current_date,date(date_created)) BETWEEN  61 AND 90;