title: What is the equivalent of Oracle's LAST_DAY() function in SQL Server 2008?
body: <p>I have used the <a href="http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions072.htm" rel="nofollow">LAST_DAY() function</a> in Oracle like this:</p>
  
  <p><code>Last_Day( to_date( '$pay_first_day' , 'YYYY-mm-dd') )</code></p>
  
  <p>What do i have to do in SQL server 2008 R2 database to achieve the same result?</p>