Who is online?  0 guests and 0 members
Home  »  Blogs  »  marcoadf: April 2012

Communifire Blogs

Blogs RSS Feed

marcoadf :April 2012 postings

marcoadf

Function to calculate end of month - SQL Server 2012 - new function EOMonth

4/2/2012 by marcoadf  -  Comments: 4  -  Views: [2540]

As in my previous blog posts, I've been posting some new features in SQL Server 2012. In today's post, I would like to show you a new T-SQL function wich will lead you to solve a daily problem. So far, when you needed to get the last day from current month you would do something like example below: select dateadd(MONTH,1,convert(datetime,left(convert(varchar,GETDATE(),112),6)+'01'))-1 Result: 2012-04-30 00:00:00 which in other words, these are the steps we are doing: - convert(varchar,GETDATE(),...

Read More

Page 1 of 1 (1 items)