.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 to get the first date of previous month?

Posted By: Deco     Posted Date: September 20, 2010    Points:2   Category :Sql Server
I have to pass the current date to a function and have to get the
first date of previous month. Please help me to find it.

Responses
Author: Syed Shakeer Hussain          Accepted Answer   
Posted Date: September 21, 2010     Points: 10   

Hi,

Use the below query



select DATEADD(month,datediff(month,0,getdate())-1,0)







Author: Deco             
Posted Date: September 21, 2010     Points: 5   

Thank you Syed

Your Query is working fine.

Regards,
Deco


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