declare @iyear int declare @imonth int set @iyear=2019 set @imonth =9 declare @ddate as nvarchar declare @ddate1 as nvarchar(100) print cast(@iyear as nvarchar)+'-'+cast(@imonth as nvarchar)+'-01' set @ddate=cast(@iyear as nvarchar)+'-'+cast(@imonth as nvarchar)+'-01' set @ddate1=cast(@iyear as nvarchar)+'-'+cast(@imonth as nvarchar)+'-01' print @ddate print @ddate1
2019-9-01 2 2019-9-01