Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > SQL Queries

Reply
 
 
Allen
Guest
Posts: n/a

 
      07-05-2010
This is probably the wrong group for this question but here goes anyway. I
have the following SQL 2005 query:

SELECT DATENAME(month,DateEvent), COUNT(MatterNo)
FROM tblMatx
WHERE WorkType = 'MPS2' AND AgendaCode = 'COMPOSS' AND FutureActual = 'R'
AND DateEvent BETWEEN '01/04/2010' AND '30/06/2010'
GROUP BY DATENAME(Month, DateEvent), MONTH(DateEvent)
ORDER BY Month(DateEvent)

Which returns the following results:
May 8
June 1

I need to to return April and 0 as well. This will apply to other months
in other quarters of the year. Is there a way in T-SQL to force it to
return ALL the months in a quarter?

TIA.

--
ats@work

When an old lady got hit by a truck
I saw the wicked gleam in your eyes

Adam and The Ants - Whip In My Valise
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Backup Not Completeing Bogong Windows Small Business Server 11 05-11-2010 02:00 PM
Installing SQL on the SBS server Jarryd Windows Small Business Server 3 05-05-2010 05:07 PM
sbs 2003 network slow why? john Windows Small Business Server 9 04-03-2010 11:10 PM
Building custom reports - Need help with sql query Björn Axéll Update Services 15 03-31-2010 02:54 PM
Running sql server 2000 and/or sql server 2005 on sbs 2003 Mark Windows Small Business Server 1 11-27-2009 10:00 AM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59