select convert(decimal(12,0),getdate()) = 40167select convert(decimal(12,4),getdate()) = 40166.5383
select cast( cast(datepart(year,getdate()) as varchar) + -- get the year right('0' + cast (datepart(month,getdate()) as varchar),2) + --get the month and zero pad right('0' + cast (datepart(day,getdate()) as varchar),2) --get the day and zero padas numeric(10,0)) -- convert back to a numeric(10,0)
SELECT CONVERT(VARCHAR(35),@date,112)--results = '20091221'
select convert(varchar(100), getdate(), 112);