7 Replies Latest reply on Mar 21, 2014 2:40 PM by DavidJondreau

    Unexpected result in Date Calc

    ninja

      Howdy all,

       

      Ran into a date calc behavior I didn't expect...so I'm checking my expectations.

       

      I have a manually entered date field, and I'm trying to calculate "first day of two months ago".

      All works fine...but now the date is January (or Febraury).

       

      The Calc for the date 'two months ago":

       

      Date(

      Month (DateField) - 2 ; 1 ; Year(Datefield)

      )

       

      Oddly enough, when I put in 1/31/2014, I get 11/1/2013.....why did I not get 11/1/2014 ?

       

      Why does the calc of month, which I thought to be a standalone within the function, still affect the year which is another part of the same function?

       

      If I did the subtraction outside of the Date() function I would have expected this...but inside of the date function I would have expected the month and year to be treated as discrete entities.

      Do I have some syntax wrong somewehere?

      Is this normal and expected behavior?

       

      Thankful your your input...