Saturday, August 25, 2012

Truncate Time

Function to truncate the time from the given date using SQL Server

ALTER FUNCTION [dbo].[TruncateTime]
(
@dateToConvert datetime
)
RETURNS datetime
AS
BEGIN
RETURN convert(datetime, convert(varchar(10), @dateToConvert, 101))
END

No comments: