Hi Pals,
I need to increment date by 1 month each from a given date for 12 month. I am doing this in report in OnPreReport() trigger.
For eg.: Date input: 01/03/2012. (1st month)
It should get increment by 1 month (for 12 months).
01/04/2012 (2nd month)
01/05/2012 (3rd month)
-
-
-
01/13/2013 (12th month)
Can anyone help me how to do it?
Thanks in advance,
Aravindh
0
Answers
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
NewDate as Date
Eg
EVALUATE(PeriodLength,'1M');
NewDate := CALCDATE(PeriodLength,140212D);
This is language dependent! Although month is often translated to another word starting with an m there is no guarantee that it always will.
Language independent version:
also read up on dateformulas and maybe even the virtual Date table.
|To-Increase|
Variables
The below inputs I will give in report's request form.
NoofTimes - integer
DueDate - date
I wrote the below coding in OnPreReport().
For example:
Input:
NoofTimes = 5
DueDate = 01/03/2012
I am getting the correct values for 1st and 2nd. From 3rd to 5th I am getting the same value which is same as 2nd which is wrong. That is..
I must get..
What to do to get this?
Try this code
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
:thumbsup: Thanks a lot Mohana, Sameer, Sog for your replies and help.
welcome
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav