Tuesday 17 October 2017

Sql server Sort date format


select CONVERT(varchar(12),getdate(),1) --// Result 10/18/17
select CONVERT(varchar(12),getdate(),2) --// Result 17.10.18
select CONVERT(varchar(12),getdate(),3) --// Result 18/10/17
select CONVERT(varchar(12),getdate(),4) --// Result 18.10.17
select CONVERT(varchar(12),getdate(),5) --// Result 18-10-17
select CONVERT(varchar(12),getdate(),6) --// Result 18 Oct 17
select CONVERT(varchar(12),getdate(),7) --// Result Oct 18, 17
select CONVERT(varchar(12),getdate(),8) --// Result 11:16:55
select CONVERT(varchar(12),getdate(),9) --// Result Oct 18 2017
select CONVERT(varchar(12),getdate(),10) --// Result 10-18-17

select CONVERT(varchar(12),getdate(),11) --// Result 17/10/18
select CONVERT(varchar(12),getdate(),12) --// Result 171018
select CONVERT(varchar(12),getdate(),13) --// Result 18 Oct 2017            select CONVERT(varchar(12),getdate(),14) --// Result 11:15:40:210

No comments:

Post a Comment

Excel Sort values in ascending order using function TEXTJOIN

 Excel ::  Text ::  1,3,5,2,9,5,11 Result :: 1,2,3,5,5,9,11 Formula ::     TEXTJOIN ( ",",1,SORT(MID(SUBSTITUTE( A1 ,","...