Date Formulas

tentacletentacle Member Posts: 27
Hi,

in Navision help under the topic "Using Date Formulas" you can read for example:

10D 10 days from today

When entering these formulas in date fields I get the error message "10d is not a valid date".

What am I doing wrong?

I also tried different languages (10t in German for example)

Comments

  • ServalServal Member Posts: 51
    Hi tentacle,

    This formula should be used in fields of type "DateFormula".
    You are trying to enter the formula in a "Date" field, that's why you are geting the error.
  • garakgarak Member Posts: 3,263
    Hi, you will insert these fomula in an Date Field. Thats the mistake

    The Dateformula (propertie or Variable) is used to calculate an date.

    Here an example

    Calcformula := 'CQ+1M-10D'; // Current quarter + 1 month - 10 days
    //German Version: LQ+1M+10T (L -> Laufender, T -> Tage
    TheDate := 14082007D;;
    CalculatedDate := CALCDATE(Calcformula,TheDate);
    MESSAGE('Datum = %1',CalculatedDate);

    Displayed: 20.10.2007

    Regards
    Do you make it right, it works too!
  • ServalServal Member Posts: 51
    FYI :
    to make your calculation fully multilanguage use this :
    Calcformula := '<CQ+1M-10D>';
  • tentacletentacle Member Posts: 27
    thanks!

    So if I want to fill a datefield with the date "today in 60 days" I must add a second field of the type Dateformula which calculates the correct date and insert this date in the datefield afterwards?
  • ServalServal Member Posts: 51
    That's it !
  • David_CoxDavid_Cox Member Posts: 509
    If you just want to add or take off days then you do not need to use calcdate.

    WORKDATE - 10
    TODAY - 10

    MyDate := 010107
    MyDate + 10

    David
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
Sign In or Register to comment.