SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Month
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

nicci113
Starting Member

11 Posts

Posted - 10/24/2012 :  05:55:31  Show Profile  Reply with Quote
SELECT cvw_FlatView_Cases.NoticeNumber, cvw_FlatView_Cases.IssueMonthYear
FROM SiDem_Reports.dbo.cvw_FlatView_Cases cvw_FlatView_Cases
WHERE (cvw_FlatView_Cases.IssueDate>={ts '2012-04-01 00:00:00'} And cvw_FlatView_Cases.IssueDate<=getdate())
GROUP BY cvw_FlatView_Cases.NoticeNumber, cvw_FlatView_Cases.IssueMonthYear

Result:

HQ03037830 May-2012
HQ03201140 May-2012
HQ03147282 May-2012
HQ03039654 May-2012
HQ03201151 May-2012


Hey Can you please guide, the above is my SQL and below is the result I am getting. I only want to count the number of HQ% that comes in a month and dont want to see the actual number any help?

nigelrivett
Flowing Fount of Yak Knowledge

United Kingdom
3383 Posts

Posted - 10/24/2012 :  05:59:31  Show Profile  Visit nigelrivett's Homepage  Reply with Quote
maybe

SELECT count(*), cvw_FlatView_Cases.IssueMonthYear
FROM SiDem_Reports.dbo.cvw_FlatView_Cases cvw_FlatView_Cases
WHERE (cvw_FlatView_Cases.IssueDate>={ts '2012-04-01 00:00:00'} And cvw_FlatView_Cases.IssueDate<=getdate())
GROUP BY cvw_FlatView_Cases.IssueMonthYear

==========================================
Cursors are useful if you don't know sql.
SSIS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

nicci113
Starting Member

11 Posts

Posted - 10/24/2012 :  06:06:52  Show Profile  Reply with Quote
it does make me numpty in here, tried this but didnt worked..hate writing sql in excel. Thanks mate much appreciate
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000