I wanted to write this down for some time now…
The Convert function in SQL Server provides a means to translate SQL Server’s default date format to just about any format. However, the convertion format isn’t intuitive at all. I wanted to have a quick reference for the future and help those who had trouble finding a list of all the possible convert options in T-SQL.
The syntax for the Convert function is as follows:
CONVERT ( data_type [ ( length ) ] , expression [ , style ] )
Available Date Formats:
Other Posts:
The T-SQL LoginProperty function in SQL Server 2005
How to restart a Windows service using C#
How to insert a file in an image column in SQL Server 2005
Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.