In previous SQL versions we don't have any direct option to get the last day of month using current date or custom date.In Sql 2012 come up with some new built function to get End of Month value i.e EOMONTH.In this post i will given how to use this function in T-Sql.
SELECT EOMONTH ( date ) as LDM,First_Name,Addr,Country from EmployeeIf we will given an input like '09/03/2012',Then the result will be like this '2012-09-30'
1 comment:
What a waste of product development time.
Any programmer of worth would have already written their own function to do this. - take a day off the first of the month following the month of the date provided - simple specification.
Post a Comment