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
 SQL
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

syedrafi
Starting Member

India
1 Posts

Posted - 04/10/2012 :  09:30:57  Show Profile  Reply with Quote
hi how to retieve the data based on joiningdate
Eg : Joining date of member on last month 10/3/2012
now i have to display the result for every month which is based on joining date .


syedrafi

webfred
Flowing Fount of Yak Knowledge

Germany
8513 Posts

Posted - 04/10/2012 :  10:51:42  Show Profile  Visit webfred's Homepage  Reply with Quote
select
year(joiningdate) as [Year],
month(joiningdate) as [Month],
count(*) as [MembersJoined]
from table
group by year(joiningdate), month(joiningdate)


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
47035 Posts

Posted - 04/10/2012 :  15:23:07  Show Profile  Reply with Quote
what according to your represents a month period? is it same as actual month or is it 30 day window from joining date?

ie 10/3/2012 to 09/04/2012 - Month1
10/4/2012 to 09/05/2012 - Month2 etc

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

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.08 seconds. Powered By: Snitz Forums 2000