I have a workflow where I have a field for month and a field for year.
I need to calculate the number of days in any given year as well as the number of days in each month. Is this possible without a specific date? Attaching a photo of the data as an example.
I want to avoid having to hardcode number of days in a year as 365 or 366 for leap year, as well as hardcoding the number of days each month.
For example, for April 2020 I would want it to return days in the year as 366 and days in the month as 30.
Year is a double if that makes a difference.
Hi @hannahrakow, take a look at this post, it is quite similar to what you are looking for - in short, even if you just have a year and a month, you can create a formula to extend that to a full date, let's say the 1st of a given year, and the last day of a given year...then you can do a DateTimeDIff - take a look:
@hannahrakow
I hope this is what you want. If you like it, appreciate if you would mark it as accept.
Hi @hannahrakow
Here is a workflow for the task.
Output:
Workflow:
Hope this helps 🙂
If this post helps you please mark it as solution. And give a like if you dont mind 😀👍
Hi @hannahrakow
Fixed it my current formulas
Hope this helps 🙂
Nice use of DateTimeTrim(Date,'lastofmonth') @OllieClarke 🙂