select left( 29/cast( 12 as float), charindex( '.',cast( 29/cast( 12 as float) as varchar(10)))+2) select CONVERT(char(4),DATEPART(year,getdate()))+'-'+CONVERT(char(2),DATEPART(month,getdate()),121)+'-1'