SELECT CONVERT(varchar, DateField, 101) AS DateField FROM [someTable]
Where DateField is the field name that holds your date, and 10 being the format. See this page for formats: http://msdn.microsoft.com/en-us/library/aa226054.aspx
Problems: If you're looking to sort this field, don't expect it to sort like a DateTime field as this converts it to a varchar field.
No comments:
Post a Comment