Say I have a column
Date 23-03-2019 04-04-2019
I want to find hoe many minutes the whole month has in MySQL.
Expected output:
Date MinsinMonth 23-03-2019 44640 04-04-2019 43200
Advertisement
Answer
This should work:
SELECT DAY(LAST_DAY(Date)) * 1440 AS MinsinMonth
LAST_DAY returns the last day in the month a date is in
DAY Returns the day number associated to a date
1440 is the number of minutes per day (60 * 24)