Saturday, October 5, 2013

Date Formats using CONVERT() Function SQL SERVER

In the Previous article, we learned about the Convert() function,  which can be used to change the date format in what ever format we like. Now, In this article we will see How to get various date formats  using Convert() function.

One of the Most frequently asked questions in any of the Interview or in any of the SQL Server forums is - How to extract only Date value from DATETIME column or How to change the DATETIME value in to a specified format. The answer to all these queries is by using the Convert() function. The CONVERT function's third optional parameter  ‘style’ plays a vital role in formatting the value while  converting the  a datetime value to a VARCHAR.
Let us see various Standard Date Formats that are available in SQL Server.


No comments:

Post a Comment

Complete Authentication System in ASP.NET Core using JWT

JWT (JSON Web Token) authentication is widely used for securing APIs in modern applications. In this article, we will build a complete authe...