I'm trying to design a somewhat dynamic query that looks similar to:
Jan --- Feb --- Mar --- Apr <b>...</b> Dec --- YTD
The problem is two-fold.
First my predecessor had hard-coded the dates for each year (for each column except YTD) but I believe the dates should be dynamic, in the sense that I always receive the last 36 months of history. (So in 2008, I won't be seeing 2002-2004 data).
Next I need to have this Year-to-date total column. What this means is that, if we are in August, we see the total for Jan '03-Jul '03 in the 2003 row, Jan '04 - Jul '04 in the 2004 row, etc.