· This is kind of Tricky because every month is not ends with same day(Day number)
Eg- January -31, February -28,29, April-30
· As a developer we needs to use several functions or Method to retrieve the correct result
· But Microsoft SQL server got built in function SELECT EOMONTH ( @date )
· SELECT [SellStartDate] , IIF([SellStartDate] = EOMONTH([SellStartDate]), 'LastDay', '') LastDay
FROM [Production].[Product]
· But the limitation is EOMONTH() only supports for 2012 SQL server and Higher
No comments:
Post a Comment