Announcement

Collapse
No announcement yet.

Datetime\add problem

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Datetime\add problem

    Hello,
    I want to calculate the end date after given start date by value of period.
    In other words: I have a start day and have to choose a period of 12, 24, 36 .... months (provided by enum field). In another field I want output of the end date by formula.

    My formula:

    Code:
    IfThen(
    period=12,
    endDate=(datetime\addYears(startDate, 1)
    );
    Then I apply that formula for each of the different periods, like period=24, period=36 etc. with year value accordingly increasing to 2,3, etc.
    The formula works, but it only uses the last period (60 months, 5 years, which is the last formula combination of five)). Whenever I choose another period, it jumps back to 60 months and applies 5 years.

    I don`t see the reason, is there something wrong with my formula?

  • #2
    You need to use == operator instead of =.


    period == 12

    Comment


    • #3
      yuri , thank you, I understand. But when I change to this operator, it does not calculate at all. Very strange.

      Comment


      • #4
        Hello,

        enumField ... try. =='12'
        or maybe another function.. but not time to test

        Comment


        • #5
          item, ok, that worked finally, well it has to be: period == '12'
          thankyou!

          Comment

          Working...
          X