Date and Time Conversion in SQL Server (MSSQL)

Date and Time Conversion in SQL Server (MSSQL)

To get different SQL Server date and time formats, use the following process. It will help in date and time conversion in MSSQL. Use the date format option along with CONVERT function To get YYYY-MM-DD use SELECT CONVERT(varchar, getdate(), 23) To get MM/DD/YYYY use SELECT CONVERT(varchar, getdate(), 1) Check out the chart to get a list of all format options A comprehensive list of formats supported by MSSQL/SQL server are provided below along with example output.  The date used for all of these examples is “2006-12-30 00:38:54.840”. Date Formats Format…

Read More