End of Month for Given Date

Finds end of the month with given date

Create FUNCTION [dbo].[EndOfMonth]

(

	@date datetime

)

RETURNS datetime

AS

BEGIN


  return 	DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,@date)+1,0))


END



This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *