Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi
I´m trying to rewrite a datefield. If the date are less then 2011-01-01 I want to set it to 2011-01-01. By I would like it to be dynamic so it check against yearstart 3 years back. (next year it should check against 2012-01-01...)
If(Datefield < YearStart 3 years back from today, rewrite to Yearstart 3 years back else use Datefield) as NewDatefield
My problem is how to write that.
Year(YearStart(Today()))-3) gives me 2011.
So I guess´d another Yearstart would fix it but it did´t work YearStart(Year(YearStart(Today()))-3)
Try
yearstart(today(),-3)
yearstart will return a date, year(yearstart(....)) will return a year. If you want the first of januari 2011 returned you can use yearstart(today(), -3).
USE BELOW EXP:
year(AddYears(YearStart( today()),-3))