Hi Team,
I need to calculate total number of days in a month but thing is I do not have a date but I have the month name of number. For example "September" or 9.
Can we calculate total number of days in the month by only using month name or number.
Appreciate any help around this.
Thanks in Advance.
Solved! Go to Solution.
Hey @hemant86 , do you have year information as well as no. of days in February varies in leap year.
Thanks @ATelore. for your response. I do not have year info but we can always take current year I guess. I am taking the input from user which will always be month name.
Hi @hemant86
If the month is in a numerical format try using this
DateTimeFormat(DateTimeTrim(DateTimeParse(ToString([Month]),'%m'),'lastofmonth'),'%d')
If its in month name format try this
DateTimeFormat(DateTimeTrim(DateTimeParse([Month],"%b"),'lastofmonth'),'%d')
This is a bit of a cheaty way but as you're going to default to the current year, this will give you the last day of the month for the given month and hence the number of days for that month
Thanks @DavidSkaife . This woks great for me. Appreciate your help😊