Find End of a Day for Given Date

Determines the last second for the day for the given date

CREATE FUNCTION [dbo].[EndOfDay]

(

	@DATE DATETIME

)

RETURNS DATETIME

AS

BEGIN



	RETURN DATEADD(s,-1,DATEADD(d, DATEDIFF(d,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 *