Convert datetime to varchar as yyyyMMdd in SQL Server

SELECT 
  CONVERT(CHAR(8), [datetimecolumn], 112)
FROM [table]
More info about CONVERT

Comments

Popular posts from this blog

Parse XML to dynamic object in C#

C# Crop white space from around the image