It is very difficult to achieve, but how can I assign @retval3, 2, 1, 0to the AS?USE RCS;DECLARE @DateColumnsQuery3 NVARCHAR(MAX);DECLARE @retval3 NVARCHAR(MAX); DECLARE @ParamDefin3 NVARCHAR(MAX);DECLARE @DateColumnNames3 NVARCHAR(MAX);SET @ParamDefin3 = N'@retvalOUT3 NVARCHAR(MAX) output';SET @DateColumnsQuery3 = N'Select @retvalOUT3 = DATEADD(month, -3, GETDATE())'; EXEC sp_executesql @DateColumnsQuery3, @ParamDefin3, @retvalOUT3=@retval3 OUTPUT; Select @retval3; EXEC sp_executesql @DateColumnsQuery3, @ParamDefin3, @retvalOUT3=@retval3 OUTPUT; DECLARE @DateColumnsQuery2 NVARCHAR(MAX);DECLARE @retval2 NVARCHAR(MAX); DECLARE @ParamDefin2 NVARCHAR(MAX);DECLARE @DateColumnNames2 NVARCHAR(MAX);SET @ParamDefin2 = N'@retvalOUT2 NVARCHAR(MAX) output';SET @DateColumnsQuery2 = N'Select @retvalOUT2 = DATEADD(month, -2, GETDATE())'; EXEC sp_executesql @DateColumnsQuery2, @ParamDefin2, @retvalOUT2=@retval2 OUTPUT;Select @retval2;DECLARE @DateColumnsQuery1 NVARCHAR(MAX);DECLARE @retval1 NVARCHAR(MAX); DECLARE @ParamDefin1 NVARCHAR(MAX);DECLARE @DateColumnNames1 NVARCHAR(MAX);SET @ParamDefin1 = N'@retvalOUT1 NVARCHAR(MAX) output';SET @DateColumnsQuery1 = N'Select @retvalOUT1 = DATEADD(month, -1, GETDATE())'; EXEC sp_executesql @DateColumnsQuery1, @ParamDefin1, @retvalOUT1=@retval1 OUTPUT;Select @retval1;DECLARE @DateColumnsQuery0 NVARCHAR(MAX);DECLARE @retval0 NVARCHAR(MAX); DECLARE @ParamDefin0 NVARCHAR(MAX);DECLARE @DateColumnNames0 NVARCHAR(MAX);SET @ParamDefin0 = N'@retvalOUT0 NVARCHAR(MAX) output';SET @DateColumnsQuery0 = N'Select @retvalOUT0 = DATEADD(month, -0, GETDATE())'; EXEC sp_executesql @DateColumnsQuery0, @ParamDefin0, @retvalOUT0=@retval0 OUTPUT; Select @retval0; select final.RespName, final._3Months AS @retval, final._2Months AS @retval2 ,final._1Month AS @retval1 , final._0Month @retval0 from