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