Reputation: 25
I have a date parameter that I want to set to be set for the 1st of the most recent October, for now it would be '10/01/2021'.
I have tried this expression:
="10/01/" & IIf(Month(Today()) < 10, Year(Today()), DateAdd("yyyy",-1,YEAR(Today())))
Which throws this error: Argument 'DateValue' cannot be converted to type 'Date'. Even besides error, not sure if the logic is right.
Any solutions?
Upvotes: 0
Views: 89
Reputation: 21683
=DateSerial(
IIF(Month(today()) >=10 , Year(Today()), Year(Today()) - 1)
, 10
, 1)
Upvotes: 1
Reputation: 3195
You can use the following expression
=DateSerial(Year(Today()), 10, 1)
Upvotes: 1