When using the EOMONTH function on a datetime datatype field the result is incorrect in my opinion.
Declare @endofmonth as datetime
Declare @startofmonth as datetime
Set @startofmonth = datefromparts(2021,5,1)
Set @endofmonth = EOMONTH (@startofmonth)
print @endofmonth
Result: May 31 2021 12:00AM
However result should be: May 31 2021 11:59PM
It is easily to avoid by choosing a Date in stead of a Datetime datatype, but still....