Wednesday, March 7, 2012

Dynamic Dates in Columns on Matrix Report

I need to display 12 months dynamically in columns of a matrix report, starting with the current MMM, yy - 3 in the first column, current MMM, yy and incrementing by 1 month in columns 2-12.

For example a report that would run on today's MM, yy (5/2007) would look something like this:

MAR-07, APR-07, MAY-07, JUN-07, JUL-07, AUG-07, AUG-07, SEP-07, OCT-07, NOV-07, DEC-07, JAN-08, FEB-08

(Col 1 - Col 12 separated by commas)

How do I do this in a matrix report column?

I would do this by created an enumerated type for months and then iterate through them based on current month value(5). when you reach 12(or 13 depending on starting value) then reset to 0 or 1 respectively and increase the year by one.

Eric

|||

I'm still not sure how to actually do this. Can you send me an example of how to do this?

|||

Can you post your code please so I understand what you need.

|||

I ended up declaring a begindate and enddate, based on the current month in the stored procedure and passed that in.

No comments:

Post a Comment