Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

get the date with 0

$
0
0
select case when LEFT(RIGHT('20060903',2),1) = 0
then
 CONCAT(0, COALESCE(CONCAT(RIGHT(20060903,2),LEFT(RIGHT(20060903,4),2), LEFT(20060903,4)),'' ))
 Else
	0
	---COALESCE(CONCAT(RIGHT(20060903,2),LEFT(RIGHT(20060903,4),2), LEFT(20060903,4)),'' )
	 	end Full_Date





 result
-------------------
3092006

expected result
-------------------
03092006


ShanmugaRaj


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>