Hi, I'm using Crystal 10.
I want to build a report which lists me values for the last 12 months from the date the report is run.
If I run the report in April 2013 it will show values back until May 2012.
This would usually not be a problem, but in the table I'm using every month is in a seperate column like shown below.
Year|Month1|Month2|Month3|...|Month12
How can I dynamically show the last 12 months from any give date?
This formula would work if the report was run in April to show me the value for March. However if I run the report in May, Month -1 would be April and I would have to show {TABLE.MONTH4} and not {TABLE.MONTH3}
I want to build a report which lists me values for the last 12 months from the date the report is run.
If I run the report in April 2013 it will show values back until May 2012.
This would usually not be a problem, but in the table I'm using every month is in a seperate column like shown below.
Year|Month1|Month2|Month3|...|Month12
How can I dynamically show the last 12 months from any give date?
This formula would work if the report was run in April to show me the value for March. However if I run the report in May, Month -1 would be April and I would have to show {TABLE.MONTH4} and not {TABLE.MONTH3}
Code:
IF month(DateAdd("m",-1,currentdate)) = 3 THEN {TABLE.MONTH3}