Wednesday, September 24, 2008

Let's Talk about .. SQL Server 2005-How to convert datetime to date string

Since type Datetime in SQL Server 2005 consists of both date and time, thus sometimes when we want only date we need to do something. This is one of the ways to convert datetime.

[SQL]
CONVERT(varchar, CONVERT(datetime, convert (datetime, convert (varchar, datecol, 101), 101) ), 100)

No comments: