SQL Server EOMonth End of Month Function to Calculate Last Day of Month
SQL Server EOMonth() function returns the last day of the month that the input argument start_date is in that month. There is an optional input parameter offset, which helps T-SQL developers to find the end of month that is N months later or before the input start date argument. The default value of offset parameter month to add or month to substract is 0.
SQL EOMonth datetime function is first introduced to SQL Server developers with the release of SQL Server 2012.
Here is a few SQL code where the new datetime function EOMonth is used to calculate the last date of the month where the input date parameter is in
Now T-SQL programmers can pass the offset argument value of the SQL EOMonth function, instead of the default 0 value.