Create Date in SQL Server

Today i wanted to create sql server date using year,month,day part.

Sql server doesn’t have any system function like createdate.

I have a small snippet to show you to create it in a simpler way.

[code:sql]
declare @y int,@m int,@d int;
set @y = 2010;
set @m = 4;
set @d = 16;
select dateadd(yy,(@y-1900),0) + dateadd(mm,@m-1,0) + @d-1
[/code]