Thursday, 15 April 2010

How to get date from sql server in user specified format -


I want to get the date from the SQL server in the user specified format using the GETDATE () function.

If I give this query

  choose GETDATE ()  

then it is displacing the output date in this format < / P>

  2015-03-17 07: 29: 58.377  

But I want output in this way.

> Help me with this problem which statement should be added to the query to get the results.

just use convert () :

  Select Convert (varchar (10), getdate (), 121)  

No comments:

Post a Comment