.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

How can we find the present quarter using Sql Server?

Posted By: Deco     Posted Date: October 11, 2010    Points:2   Category :Sql Server
please give me the query to find the current quarter from the GetDATE(), i should get the result as '04'

Responses
Author: Sajid P K             
Posted Date: October 12, 2010     Points: 5   

Dear Alwn, Follwing may help full to you....


SELECT   DATEPART( qq, GETDATE() ) 




Regards,
Sajid P K

Author: Santosh             
Posted Date: October 15, 2010     Points: 5   

hi alwyn,

please check below...

SELECT datepart(qq, ColumnName) as quarter, count(*) as rows
from TableName
group by datepart(qq, ColumnName)

hope this will help u...........

Regards
Santosh




Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend