Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I have two variables in my load script.
Let vCurrentMonthStart = '11/01/2020';
Let vCurrentFiscalYear = Right(YearName($(vCurrentMonthStart), 0, 4), 4);
vCurrentMonthStart works correctly and returns the date 11/01/2020.
vCurrentFiscalYear evaluates vCurrentMonthStart as a math problem and returns 1900 instead of the desired 2021 for our Fiscal Year. (11/1)/2020 = 0.0054455445544554
What am I doing wrong? THANKS IN ADVANCE!!!
I figured it out. Surrounding the vCurrentMonthStart in quotes forced it to evaluate as a date and works now.
Let vCurrentFiscalYear = Right(YearName('$(vCurrentMonthStart)', 0, 4), 4);
I figured it out. Surrounding the vCurrentMonthStart in quotes forced it to evaluate as a date and works now.
Let vCurrentFiscalYear = Right(YearName('$(vCurrentMonthStart)', 0, 4), 4);