• Stephen W. Thomas
  • Azure Integration Gurus
BizTalkGurus
  • Home
  • Blogs
    • Stephen’s BizTalk and Integration Blog
    • BizTalk Community Blogs via Syndication
  • Forums
  • Downloads
  • Videos
  • Training
    • Online Training
    • Classroom Training
Select Page

T-SQL to get first and last days of last month

by community-syndication | May 11, 2009 | BizTalk Community Blogs via Syndication

I remember searching for this T-SQL statement a few months ago, so time to put it on the blog.

select dateadd(m, datediff(m, 0, dateadd(MM, -1,getdate())), 0) as [Date of First Day of Last Month]
select dateadd(m, datediff(m, 0, dateadd(m, 1, dateadd(MM, -1,getdate()))), -1) as [Date of Last Day of Last Month]

  • Facebook
  • Twitter
  • Google+
  • Gmail
  • LinkedIn

Search this Site:


Recent Posts

  • Logic App Consumption deployment: The secret of KeyVault parameter cannot be retrieved. Http status code: ‘Forbidden’. Error message: ‘Access denied to first party service
  • BizTalk Server Visual Studio project: attempted re-targeting of the project has been canceled.
  • BizTalk Oracle Adapter error: The assembly required for type mapping not found.
  • PowerShell script to identify all SQL V1 actions and triggers inside Logic Apps Consumption
  • Friday (funny) Fact: There is no size limit for the Logic App parameter name

Tweets by AzureIntGurus

Recent Topics

  • Evaluating on the amount of items returned in a message
  • Send and Receive ports problem
  • How to config/costom a WS Security to SOAP header
  • Email attachments – POP3 adapter
  • Calling ASP page from Biztalk Orchestration

  • Home
  • Blogs
  • Forums
  • Downloads
  • Videos
  • Training
  • Facebook
  • X
  • RSS
@BizTalkgurus.com