Reputation: 51
I am trying to set a default date to be the fist day of the previous April. I have found expressions for the 1st day of previous month
=DateValue(DateAdd("M",-1,DateAdd("D",-(Day(Now)-1),Now)))
And I have found an expression for 1st day of April for current year (=CDATE("04/01/"+CStr(Year(NOW())
) but I always need to find the previous April, not April of the current year.
Is anybody able to help please?
Upvotes: 0
Views: 156
Reputation: 14108
Try:
=IIF(Today.Month>=4,DateSerial(today.Year,4,1),DateSerial(today.Year-1,4,1))
Note if you run the report in April or after you will get the current year april, if you run the report in march or before you will get the last year april.
Let me know if this helps.
Upvotes: 1