« Oracle: Renaming system-generated NOT NULL constraint names to intelligible ones | Home | RFC-(2)822/(2)821 compliant e-mail validation in PHP »

Truncate time part of datetime/smalldatetime value

If you need to obtain only date part from datetime/smalldatetime value use this code


DECLARE @date datetime
SET @date = CONVERT(varchar(8), GETDATE(), 112)

Topics: T-SQL | Submitter: bazile

Comments

You must be logged in to post a comment.