Solved How can I get the number of days in the month using Calculated field. (1 Viewer)

Local time
Tomorrow, 00:28
Joined
Aug 19, 2021
Messages
212
Hi, I want to get the number of days in the month using calculated field.
I have some fields:
1) PRDate (Type Date/Time)
2) SalaryMonth (Type Calculated) - Expression used: MonthName(Month([PRDate]))
3) SalaryYear (Type Calculated) - Expression used: Year([PRDate])

Now I want to make new field "NumberOfDays" in this field I want to get total number of days in the month used in PRDate
Some Examples:
If PRDate = 01-Feb-21 then NumberOfDays = 28
If PRDate = 01-Feb-24 then NumberOfDays = 29
If PRDate = 01-Aug-21 then NumberOfDays = 31
If PRDate = 01-Sep-21 then NumberOfDays = 30

Thank you very much,
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 03:28
Joined
May 7, 2009
Messages
19,246
NumofDays: Day(DateSerial(Year(PRDate), Month(PRDate) + 1, 0))
 

Users who are viewing this thread

Top Bottom