calcdate

karuchuakaruchua Member Posts: 151
 LPeriodStartDate[1] := 010190D;
 LPeriodStartDate[4] := CALCDATE('CM-1M',PAgeingDate);
 LPeriodStartDate[5] := PAgeingDate;
 
 FOR i := 3  DOWNTO 2 DO
   LPeriodStartDate[i] := CALCDATE('-1M',LPeriodStartDate[i+1]-1);
 FOR i := 2  TO 4 DO
   LPeriodStartDate[i] := CALCDATE('CM',LPeriodStartDate[i]);


LPeriodStartDate id of type date and has a array of 6.


but what is this guy training to do? i cant comprehend this.

Comments

  • David_CoxDavid_Cox Member Posts: 509
    edited 2013-01-23
    This bit is wrong, it is calculating a date based on the startdate, the varable could be wrong.
    FOR i := 2  TO 4 DO
       LPeriodStartDate[i] := CALCDATE('CM',LPeriodStartDate[i]); 
    

    Should this be an End Date variable like LPeriodEndDate:
    FOR i := 2  TO 4 DO
       LPeriodEndDate[i] := CALCDATE('CM',LPeriodStartDate[i]); 
    

    For code like this look in:
    Report 120 "Aged Accounts Receivable" in the function CalcDates, this sets start and ending dates!


    HTH

    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
  • mohana_cse06mohana_cse06 Member Posts: 5,504
    It should be
    FOR i := 2  TO 4 DO
       LPeriodEndDate[i] := CALCDATE('<CM>',LPeriodStartDate[i]);
    
  • karuchuakaruchua Member Posts: 151
    FOR i := 3  DOWNTO 2 DO
       LPeriodStartDate[i] := CALCDATE('-1M',LPeriodStartDate[i+1]-1);
    FOR i := 2  TO 4 DO
       LPeriodStartDate[i] := CALCDATE('CM',LPeriodStartDate[i]);
    

    but what is he trying to do here?
Sign In or Register to comment.