I am working on page which contains Start Date, End Date and No. of Month. Am trying to write a code that when I inputted the Start Date (Date), No. of Month (Integer) , it should give End Date.
Start Date - OnValidate()
IF End Date" <> 0D THEN
VALIDATE( End Date");
End - OnValidate()
IF "End Date" > "Start Date" THEN
"No. of Months" := ROUND(("End Date"-"Start Date")/30,1)
"No. of Months" := 1;
No. of Month - OnValidate()
The above code worked for the calculate of No. of Month but I need for the End Date.
You should use the CALCDATE function for this.
Something in the line of:"End Date" := CALCDATE(STRSUBSTNO('<%1M-1D>,"No. of Month"),"Start Date";
Its working nw
"End Date" := CALCDATE(STRSUBSTNO('<%1M>',"No. of Month"), "Start Date");