Tuesday, November 22, 2005

Strip Time Off SQL Server Date Variable

{

DECLARE @DOUT DATETIME
SET @DOUT = CONVERT(DATETIME, CONVERT(CHAR(10), GETDATE(), 101))
PRINT CONVERT(DATETIME, @DOUT)

}

1 comment:

Kiran said...

Hi Please check this out. It suggested a similar way to strip the time part from date time.
http://cherupally.blogspot.com/2009/09/easy-way-to-strip-time-part-in-sql-date.html

Thanks,
Kiran
http://cherupally.blogspot.com