Hi Pals,
How to calculate previous months first date and last date using the Date Filter given in report? For Eg.: While running a report, I am giving the Date Filter as 01/04/12..30/04/12. Using GETRANGEMIN, GETRANGEMAX function, I am storing the Start Date and End Date in 2 variables.
My aim is to get the previous month's Start date and End Date. That is: I need to get march month's Start Date as 01/03/12 and End Date 31/03/12. Am aware this is something to do with CALCDATE function, but what is the formula? How can I achieve this?
Thanks in advance.
Aravindh R.
0
Answers
Goes alot faster than waiting for a reply.
|To-Increase|
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Date2 := CALCDATE('<-1M>', "End Date");
Chn
Thanks for your reply. I tried the formula that you mentioned already. This formula gives the date value of:
Input: Date Filter: 01/04/12..30/04/12.
PrevStartDate : 01/03/12
PrevEndDate : 30/03/12
I need PrevEndDate as 31/03/12, since March month contains 31 days. But I am getting PrevEndDate as 30/03/12. Also how to handle for February month 28days (29 days in leap year)?
Thanks,
Aravindh.
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
PrevEndDate := CALCDATE('<-1D>', StartDate);
Chn
Thank you Chinmoy, Sog, Mohana for your suggestions. :thumbsup: