Find Start of a Year for Given Date

Finds out a start of the year for the given date.

CREATE FUNCTION [dbo].[StartOfYear]

(

	@DATE DATETIME

)

RETURNS DATETIME

AS

BEGIN



	RETURN DATEADD(yy, DATEDIFF(yy,0,@DATE),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 *