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