Hi All,
Here I am facing some problem in calculating dates.
Here is my scenario. I have three fields like
Starting Date (mm/dd/yy)
Ending Date (mm/dd/yy)
Invoice Period (with a value like Month, Two Month, quarter, Half year, year).
So, If I give the value of starting date as 12/13/06 and ending date as 04/30/07 and Invoice Period as Month.
Then, I should get the answer as 01/01/07, 02/01/07, 03/01/07, 04/01/07 (mm/dd/yy)
Plz help me out.
0
Comments
The End Date should not be entered but calculated based on the Invoice Period = Month, Two Month, quarter, Half year, year.
Is this the case?
Can you explain better how this will be used?
Mobile: +44(0)7854 842801
Email: david.cox@adeptris.com
Twitter: https://twitter.com/Adeptris
Website: http://www.adeptris.com
in your case, you should use something like: datDate := CALCDATE('<-CM+1M>',datDate);
For the next, you can use for:
Month: datDate := CALCDATE('<1M>',datDate);
Two Month: datDate := CALCDATE('<2M>',datDate);
quarter: datDate := CALCDATE('<4M>',datDate);
Half year: datDate := CALCDATE('<6M>',datDate);
year: datDate := CALCDATE('<1Y>',datDate);
It is rather easy to put this into a loop to see if your date has passed the ending date.
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog