July 24, 2003 at 3:07 am
i need to create a quarter function?
Any one going to help me...
Edited by - lital on 07/24/2003 03:07:07 AM
July 24, 2003 at 3:13 am
There's plenty of help available in this forum. What do you want the function to do? Can the "quarter" option in the DATEPART function help at all?
Cheers,
- Mark
July 24, 2003 at 3:15 am
group by year quarter
July 24, 2003 at 3:31 am
If you want to group by quarter, and year:
select
datepart(Q,Date),
datepart(yy,Date),
Count(*)
from myTable
group by datepart(Q,Date),datepart(yy,Date)
else just quarter:
select
datepart(Q,Date),
count(*)
from myTable
group by datepart(Q,Date)
as mccork said: see BOL for Datepart
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply