Selasa, 27 Juli 2021

How to format Date and Time in SQL Server and Sybase? Examples

How to format a date in SQL Server like in the "yyyymmdd" format? Suppose you have a date and time column in Sybase or Microsoft SQL Server,  which is displaying values in "Dec  31, 2011, 12:00 AM" and you want to display it in any particular DATE format like YYYYMMDD or DDMMYYYY, how will you do that? This is also one thing you need to keep in mind when you convert a DATE, TIME, DATETIME column into CHAR or VARCHAR values.  It's easy to format dates using the convert function in Sybase or SQL Server, but it's slightly difficult to remember the cryptic formatting style codes that go with it. For example, using style code, 112 is used to format dates in the "YYYYMMDD" format e.g. "20170329".

Lorem ipsum is simply dummy text of the printing and typesetting industry.

Comments


EmoticonEmoticon