Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

DateOnly (See related posts)

-- Gets the date part of a datetime input
-- Created 08/05/04 by Oskar Austegard
ALTER FUNCTION dbo.fnDateOnly
(
	@DateTime datetime --The input date whose date part we want
)
RETURNS datetime
AS
BEGIN
	RETURN (CONVERT(datetime, CONVERT(varchar(10), @DateTime, 101)))
END


Oskar Austegard
http://mo.notono.us

You need to create an account or log in to post comments to this site.


Click here to browse all 4858 code snippets

Related Posts