Please help with the following problem statement in MYSQL:
i have a start_date and end_date. I need to calculate number of days between start_date and end_date for the current month and till current date.
Example1:
start_date = "2020-06-27"
end_date = "2020-09-27"
Since today's date is 2020-08-11 (11th Aug 2020). I need 11 as the output.
Example2:
start_date = "2020-08-08"
end_date = "2020-08-09"
I need 2 as the output.
Example3:
start_date = "2020-08-08"
end_date = "2020-08-14"
I need 4 as the output because current date is 11th Aug.
I have tried, datediff, period_diff but haven't got any success yet. Please, seeking some help here.
Thanks for looking at the problem statement.