Using Array in CALCDATE

achach Member Posts: 16
edited 2004-07-09 in Navision Attain
Hi There,

Wonder if you can help with syntax want to calculate StartDate from WORKDATE - value of array M.

StartDate := CALCDATE('-i'+'m',WORKDATE);

So if array i =4 will perform the following:

CALCDATE('-4M',WORKDATE);

Thanks

Comments

  • fbfb Member Posts: 246
    As I understand your question, you have declared the following variables
    VAR
      M : ARRAY [someSize] OF Integer;
      i : Integer;
    
    Now, you wish to subtract M months from the WORKDATE -- right? If so, then I think what you are trying to do is this:
    StartDate :=
      CALCDATE(
        STRSUBSTNO('<-%1M>',M[i]),
        WORKDATE);
    
    The angle brackets around the date expression are used to avoid problems in a multi-language environment.
Sign In or Register to comment.