when we retrive date from sql server it gives aoutput in Date-time format like
select getdate(): 2009-11-02 11:58:09.513
It consist of today's date, time in hrs:min:sec:msec
But Many times requirement is to display only day not time. example Daily reports
For this there is a function like:
select convert(char,getdate(),100): Nov 2 2009 12:01PM
select convert(char,getdate(),101): 11/02/2009
select convert(char,getdate(),102): 2009.11.02
select convert(char,getdate(),103): 02/11/2009
select convert(char,getdate(),104): 02.11.2009
select convert(char,getdate(),105): 02-11-2009
select convert(char,getdate(),106): 02 Nov 2009
select convert(char,getdate(),107): Nov 02, 2009
select convert(char,getdate(),108): 12:05:19
select convert(char,getdate(),109) : Nov 2 2009 12:05:19:733PM
select convert(char,getdate(),110) : 11-02-2009
select convert(char,getdate(),111): 2009/11/02
select convert(char,getdate(),112) : 20091102
select convert(char,getdate(),113) : 02 Nov 2009 12:16:44:343
select convert(char,getdate(),114): 12:16:44:343
No comments:
Post a Comment