supportservice
Technical User
- Mar 12, 2012
- 63
Greetings
I found this great article:
And wanted to see if someone could expand on that?
I would like to set the date range to always show one month prior + 5 equaling 6 months with the relative dates but to show the actual month names with the year in the cross-tab.
If the report is ran in Jan-12 the prior month should be Dec-11 which should show first as the first column and the following months Jan-12, Feb-12, Mar-12, Apr-12, May-12.
What I have now working with the above FAQS, this is my current crosstab query:
TRANSFORM Sum(Forecasts.ForecastAmount) AS SumOfForecastAmount
SELECT Forecasts.JobNumber
FROM Forecasts
WHERE (((Forecasts.ForecastDate) Between #7/1/2011# And Date()))
GROUP BY Forecasts.JobNumber, Forecasts.ForecastDate
ORDER BY Forecasts.ForecastDate
PIVOT "Mth" & DateDiff("m",[ForecastDate],Date());
1. Would like the date range to be dynamic so that it does not have to get manually changed and have no manual input. Just need the query / report to always run for 6 months starting from the prior month of the current year.
2. To have relative months with actual names without manual input on the report.
This is my current result: (NOTE: I left the ForecastDate in to show you the dates)
I found this great article:
And wanted to see if someone could expand on that?
I would like to set the date range to always show one month prior + 5 equaling 6 months with the relative dates but to show the actual month names with the year in the cross-tab.
If the report is ran in Jan-12 the prior month should be Dec-11 which should show first as the first column and the following months Jan-12, Feb-12, Mar-12, Apr-12, May-12.
What I have now working with the above FAQS, this is my current crosstab query:
TRANSFORM Sum(Forecasts.ForecastAmount) AS SumOfForecastAmount
SELECT Forecasts.JobNumber
FROM Forecasts
WHERE (((Forecasts.ForecastDate) Between #7/1/2011# And Date()))
GROUP BY Forecasts.JobNumber, Forecasts.ForecastDate
ORDER BY Forecasts.ForecastDate
PIVOT "Mth" & DateDiff("m",[ForecastDate],Date());
1. Would like the date range to be dynamic so that it does not have to get manually changed and have no manual input. Just need the query / report to always run for 6 months starting from the prior month of the current year.
2. To have relative months with actual names without manual input on the report.
This is my current result: (NOTE: I left the ForecastDate in to show you the dates)
Code:
JobNumber ForecastDate Mth0 Mth1 Mth2 Mth3 Mth6
test1 9/1/2011 $800.00
test2 12/1/2011 $100.00
test1 1/1/2012 $5,000.00
test1 2/1/2012 $300.00
test2 3/10/2012 $400.00