I want in select records based on date condition of day only without checking month and year.
Table structure
------------------------------------
id | user_id | amount | created_on
------------------------------------
If I select date 15-April to 25-April, Then I need record between 15-April to 25-April, 15-March to 25-March and so on..
It seems quite easy with fetch day from date and compare it with
Select sum(amount) from sales where DATEFORMAT(created_on, %d) >= 15 and DATEFORMAT(created_on, %d) <=25
But how to find records when i select date 28-March to 5-April, then I need data of 28-February to 5-March, 28-January to 5-February.. and so on