|
Posted by tran.loan on 10/24/05 03:42
I have a reporting query that I need to do a quarterly trending on. A
user enters a begining date and end date, and from there, I have to
determine the closest quarter to it.
Also, the actual Quarter starts on Sept 4th, then add 13 weeks to that,
will be the second quarter.
I was able to do the trending for week/month/year, but I'm stuck on
this quarterly trending.
Any help would be greatly appreciated.
Example of the monthly trending that I have written:
SELECT [VALUE],DATEPART(MONTH,DATESAMPLE) AS[MONTH]
FROM #TABLE
GROUP BY [VALUE], DATEPART(MONTH,DATESAMPLE)
ORDER BY EDIT_SP, DATEPART(MONTH,DATESAMPLE)
Navigation:
[Reply to this message]
|