Calculate Date based on Period.

Huvan
Member Posts: 3
Hi
I need to calcualte compensation based on the date specified and i have a setup table where i will give settign calcualtion for compensation (Like if a person has been set a option of week ( Compensation calcualted based on weeks). and period is 2( 2 Week means that the compensation is calculated per 2 two weeks.)
I have a table where in i create records for all the calcualted Compensation so that its not Imported again.
My problem is how to calculate the date (for every two weeks if i give a filter of date 010510 to 31 05 10).
(*,)
I should calcualte it for all the resource that are applicable for this time period, each person have a different Calculation (week, quarter,month).
Regards
Huvan ]
I need to calcualte compensation based on the date specified and i have a setup table where i will give settign calcualtion for compensation (Like if a person has been set a option of week ( Compensation calcualted based on weeks). and period is 2( 2 Week means that the compensation is calculated per 2 two weeks.)
I have a table where in i create records for all the calcualted Compensation so that its not Imported again.
My problem is how to calculate the date (for every two weeks if i give a filter of date 010510 to 31 05 10).
(*,)
I should calcualte it for all the resource that are applicable for this time period, each person have a different Calculation (week, quarter,month).
Regards
Huvan ]
0
Comments
-
Is it a question? Wrong forum?
If I understand correctly you want to calculate a date that is two weeks ahead from a given date. Take a look at the function CALCDATE.NewDate := CALCDATE('<+2W>',GivenDate); // 2 weeks NewDate := CALCDATE('<+1M>',GivenDate); // 1 month NewDate := CALCDATE('<+1Q>',GivenDate); // 1 quarter
"Money is likewise the greatest chance and the greatest scourge of mankind."0 -
Hi,
I too know how to work on calcdates.
But my question is
how to calculte in a loop for a given set of date(say for 030510..300510).
which have 4 weeks the user has an option of 2 weeks(every two weeks i have to calcualte compensation this should be calculted only twice).0 -
If you know about CALCDATE you should also know that the Expression of CALCADATE is a string. You could substitute it by STRSUBSTNO.
NewDate := CALCDATE(STRSUBSTNO('<+%1W>',NoOfWeeks),GivenDate);
And you can subtract GETRANGEMAX from GETRANGEMIN of your range to get the number of days between that two dates. Divide it by the length of your period so that you know how many iterations your loop needs."Money is likewise the greatest chance and the greatest scourge of mankind."0 -
[Topic moved from 'NAV Tips & Tricks' forum to 'NAV/Navision Classic Client' forum]Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!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