• Sorry,

    select @datestr = cast(year(@todate) as char(4)) + '-' + cast(month(@DOB) as char(2)) + '-' + cast(day(@Dob) as char(2))

    DOB might be a leap day as you said

    but todate is presumably current date = 2003 which is not -add these together you get

    2003-02-29 - which is invalid

    and yes - varchar would be a good idea