Go to home page mail me! RSS Feed

Converting SQL DateTime to Date

Monday, June 08, 2009 11:09 AM

Apparently, converting a SQL long datetime string to just a date seems to be a head banger for some people. therefore, I’ve decided to publish the way I do it, which I believe is easy and probably the most efficient.

convert(varchar(10),[datetimecolumnname],101)

 

replace [datetimecolumnname] with the column name of the actual column that is of datetime data type.

Your Comments.

No comments posted yet.

Your Reply.

Comment Form.

Fields denoted with a "*" are required.

You may also like to leave your email or website.

 
Please add 1 and 3 and type the answer here:

Preview Your Comment.

 
Next entries »