One of the most frequently used date manipulations in SQL Server is for calculating the beginning and end dates of a month. This is particularly useful in date range filters and monthly aggregation calculations. SQL 2012 has brought in a new…
Get fiscal year dates corresponding to a date value
Quite often we need aggregations to be done based on fiscal years rather than on financial years. My preferred method always has been on storing fiscal year values also along with other fields in my calendar table which can be…
Get the latest weekday of month in SQL 2012
Recently there was a requirement to get latest weekday of a month.I made use of a solution based on the EOMONTH function available in SQL 2012 for that, which I’m sharing through this blog.The UDF will look like below CREATE…