Is there a way to calculate the total days in the month we are in?

I want to calculate the % through the month. So (total days in month-current date)/total days in the month.

 

Does anyone know the beastmode to do this?

Comments

  • If you just want to count all days, then this will work: (DAYOFMONTH(LAST_DAY(CURRENT_DATE()))-(DAYOFMONTH(LAST_DAY(CURRENT_DATE()))-DAYOFMONTH(CURRENT_DATE())))/DAYOFMONTH(LAST_DAY(CURRENT_DATE()))
  • @juliannarenaud, did Shevy's reply help you out?

  • Last day of month:

    DATE_SUB(DATE_ADD(`ActualDate`, interval 1 month), interval (DAYOFMONTH(DATE_ADD(`ActualDate`, interval 1 month))) day)

    Days in month:

    DAYOFMONTH(DATE_SUB(DATE_ADD(`ActualDate`, interval 1 month), interval (DAYOFMONTH(DATE_ADD(`ActualDate`, interval 1 month))) day))