1 Reply Latest reply on Mar 20, 2013 7:54 PM by Alex Kerin

    Is there a way to do date calculation in months and years?

    Fakhzan Firdaus Bin Abdullah

      So far from what I know, we can add or subtract days from any date dimension. But is there a way to subtract in years or months? Of course we can calculate the days and do the necessary conversion to years but it wouldn't be accurate.

       

      Datediff returns the number according to the datepart, but I couldn't find a way to use the datepart in the calculation

       

      Say for example Today's date - 5 years = date 5 years ago, instead of

       

      Today's date - (365 * 5) = date 5 years almost, not counting leap years.