Date Calculation

Madhan
Member Posts: 96
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.
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
-
You cannot use CALCDATE in this scenario, unless the Start Date and End Date are set as the first and last days of the Month.
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?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.com0 -
First you should calculate the first date:
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions