Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm looking at the AddYears() function - and trying to calculate the number of years an application has been active (Effective Date).
Date(AddYears(Effective Date, 0), 'YYYY' - I'm trying to think of the logic to be able to display as such:
within one year of current date = 0
greater than one year, less than 2 = 1
and so on - what function(s) do I need to set up in the script?
Thanks in advance
To calculate number of months you can use
=((Year(EndDate) * 12) + Month(EndDate)) - ((Year(StartDate) * 12) + Month(StartDate))
divide this by 12 and use as you need.
You can use it as function also like
SET MonthDiff = Num(((Year($2) * 12) + Month($2)) - ((Year($1) * 12) + Month($1)));
then you can use this as
$(MonthDiff(startdate, enddate)) to compute.
To calculate number of months you can use
=((Year(EndDate) * 12) + Month(EndDate)) - ((Year(StartDate) * 12) + Month(StartDate))
divide this by 12 and use as you need.
You can use it as function also like
SET MonthDiff = Num(((Year($2) * 12) + Month($2)) - ((Year($1) * 12) + Month($1)));
then you can use this as
$(MonthDiff(startdate, enddate)) to compute.