I have StartDate and FinishDate paraemeters and I want their default to always be "this year" so StartDate would always be the 1st of Jan of the current year and FinishDate would be the 31st of Dec of the current year.
Is this possible with the date expressions?
Here are some example I have saved in my notebook but cannot figure out this new requirement :-)
First Day of Last Month
= Today().AddDays(CDbl(1 - Today().Day)).AddMonths(-1)
Last Day of Last Month
= Today().AddDays(CDbl(- Today().Day))
First Day of This Month
= Today().AddDays(CDbl(1 - Today().Day)).AddMonths(0)
First Day of This Month Last Year
= Today().AddDays(CDbl(1 - Today().Day)).AddMonths(-11)
Last Day of This Month
= Today().AddDays(CDbl(1 - Today().Day)).AddMonths(0).AddMonths(1).AddDays(CDbl(-1))
Hi Tommy,
To get the 1st of January of the current year, you can use the following expression:
= Date(Today().year, 1,1)
And for the last date:
= Date(Today().year, 12, 31)