Home > Archive > Microsoft SQL Server forum > October 2005 > Quarterly trending









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Quarterly trending
tran.loan@gmail.com

2005-10-27, 9:25 am

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 & #91;VALUE],DATEPART(
MONTH,DATESAMPLE) AS[MONTH]
FROM #TABLE
GROUP BY [VALUE], DATEPART(MONTH,DATES
AMPLE)
ORDER BY EDIT_SP, DATEPART(MONTH,DATES
AMPLE)

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com