Options

Addition of text and date Formula

KituiKitui Member Posts: 9
edited 2019-02-26 in NAV Three Tier
I have a challenge in adding one StringDate(text) with another to another date formular(Dateformula) then using the sum to calcdate the Futuredate(Date).
PostingDate(Date)

My wrong Take

StringDate:=FORMAT("Grace Period - Principle (M)")+'M';
Futuredate:=CALCDATE(StringDate+'CM',PostingDate);

Is there another way to achieve this?

Best Answers

  • Options
    lubostlubost Member Posts: 614
    Answer ✓
    Your "Grace Period - Principle (M)" is probably DateFormula type and adding M will be potentially bad.
    1. Futuredate:=CALCDATE(FORMAT("Grace Period - Principle (M)"+'CM',PostingDate);
    2. Better is to fill your "Grace Period - Principle (M)" field with value which can be directly usable
    3. Use <> around dateformula string inside CALCDATE function to avoid language influence.
  • Options
    KituiKitui Member Posts: 9
    Answer ✓
    lubost wrote: »
    Your "Grace Period - Principle (M)" is probably DateFormula type and adding M will be potentially bad.
    1. Futuredate:=CALCDATE(FORMAT("Grace Period - Principle (M)"+'CM',PostingDate);
    2. Better is to fill your "Grace Period - Principle (M)" field with value which can be directly usable
    3. Use <> around dateformula string inside CALCDATE function to avoid language influence.

    "Grace Period - Principle (M)" its Integer;

Answers

  • Options
    KituiKitui Member Posts: 9
  • Options
    KituiKitui Member Posts: 9
    I got through this by writing a pair of code

    This
    Futuredate:=CALCDATE('CM',PostingDate);
    Futuredate:=CALCDATE(StringDate,PostingDate);
  • Options
    lubostlubost Member Posts: 614
    Answer ✓
    Your "Grace Period - Principle (M)" is probably DateFormula type and adding M will be potentially bad.
    1. Futuredate:=CALCDATE(FORMAT("Grace Period - Principle (M)"+'CM',PostingDate);
    2. Better is to fill your "Grace Period - Principle (M)" field with value which can be directly usable
    3. Use <> around dateformula string inside CALCDATE function to avoid language influence.
  • Options
    KituiKitui Member Posts: 9
    Answer ✓
    lubost wrote: »
    Your "Grace Period - Principle (M)" is probably DateFormula type and adding M will be potentially bad.
    1. Futuredate:=CALCDATE(FORMAT("Grace Period - Principle (M)"+'CM',PostingDate);
    2. Better is to fill your "Grace Period - Principle (M)" field with value which can be directly usable
    3. Use <> around dateformula string inside CALCDATE function to avoid language influence.

    "Grace Period - Principle (M)" its Integer;
  • Options
    KituiKitui Member Posts: 9
    lubost wrote: »
    Your "Grace Period - Principle (M)" is probably DateFormula type and adding M will be potentially bad.
    1. Futuredate:=CALCDATE(FORMAT("Grace Period - Principle (M)"+'CM',PostingDate);
    2. Better is to fill your "Grace Period - Principle (M)" field with value which can be directly usable
    3. Use <> around dateformula string inside CALCDATE function to avoid language influence.

    I worked with it as integer.
Sign In or Register to comment.