Windows 2008 R2

Technical Article

RE: Calculate Last and First Day of the Month

  • Reply

Ain't date handling marvellous?  All sorts of ways of "skinning the cat".  My approach to getting the first day of the month and first of the next is as follows ... (I always use alpha for the month ... saves confusion).declare @today datetime select @today=getdate()select  '01 '+substring(convert(char(11),@today,106),4,11),   '01 '+substring(convert(char(11),dateadd(month,1,@today),106),4,11)01 Feb 2004 01 Mar 2004

You rated this post out of 5. Change rating

2004-02-02

Blogs

T-SQL Tuesday #176 One piece of advice that you wish Past you had

By

This month’s T-SQL Tuesday is hosted by a dear friend, long time SQL Server...

T-SQL Tuesday #176: One piece of advice for Past Steve

By

I almost missed this month, so this is also a good #SQLNewBlogger post. I...

Deleting Old Local Git Branches–#SQLNewBlogger

By

I had a lot of local branches for a repo (actually a few repos)....

Read the latest Blogs

Forums

7 sept, scheduled book

By philip.scott

Comments posted to this topic are about the item 7 sept, scheduled book

7 sept, schedlued article

By philip.scott

Comments posted to this topic are about the item 7 sept, schedlued article

6 sept, published book

By philip.scott

Comments posted to this topic are about the item 6 sept, published book

Visit the forum

Question of the Day

Azure Data Lake Storage Gen 2

Azure Data Lake Storage Gen 2 is built on ...?

See possible answers