If an error occurs when running above query, this means that tutorial is working with SQL Server version under 2012, and EOMONTH function is not supported.
Well, when I wrote this query, the following result was obtained
old_way
new_way
2016-07-31
2016-07-31
As we could see, EOMONTH function has date-type parameter. Moreover, there is second optional parameter which presents the number of months to be added, if any, to the first parameter. For example, the following query gives the latest days of previous month, current month and next month for the date '2016-01-28' respectively: