Show dates on different format through Query

Posted by Venkat | Labels: ,

Here the number of way to show the date ie: extract from the SQL query

select convert(varchar,getdate(),101)
OutPut:- 06/18/2008

select convert(varchar,getdate(),102)
OutPut:- 2008.06.18

select convert(varchar,getdate(),103)
OutPut:- 18/06/2008

select convert(varchar,getdate(),104)
OutPut:- 18.06.2008

select convert(varchar,getdate(),105)
OutPut:- 18-06-2008

select convert(varchar,getdate(),106)
OutPut:- 18 Jun 2008

select convert(varchar,getdate(),107)
OutPut:- Jun 18, 2008

select convert(varchar,getdate(),108)
OutPut:- 10:53:20

select convert(varchar,getdate(),109)
OutPut:- Jun 18 2008 10:53:30:507AM

select convert(varchar,getdate(),110)
OutPut:- 06-18-2008

select convert(varchar,getdate(),111)
OutPut:- 2008/06/18

select convert(varchar,getdate(),112)
OutPut:- 20080618

select convert(varchar,getdate(),113)
OutPut:- 18 Jun 2008 10:54:01:253

select convert(varchar,getdate(),114)
OutPut:- 10:54:08:473

select convert(varchar,getdate(),120))
OutPut:- 2008-06-18 10:54:15 
For Further Reference : http://www.sql-server-helper.com/tips/date-formats.aspx

0 comments:

Post a Comment

Thanks for the Comments.

PayOffers.in