Posted on: 4/19/2012 6:03:06 AM | Views : 325

I am in converting stored procedure to normally SQL query in stored procedure i have got:
DECLARE @RepMonth as nvarchar(6) DECLARE @Local_Year nvarchar(4) SET @RepMonth = convert(CHAR, dateadd(month, 0 ,getdate()), 112) SET @Local_Month = left(@RepMonth,4) + '-' + RIGHT(@RepMonth,2) END SELECT Service AS [Network ], Dart, Co, SUBSTRING(CAST(AVG(tryu) AS NVARCHAR(10)),1,5) + ' %' AS [Port] INTO #Temp_rr FROM dbo.exis WHERE CONVERT(CHAR, dttim, 120) like @local_Month + '%' GROUP BY Network, Dart, Co ORDER BY Dart SELECT * FROM #Temp_rr DROP TABLE #Temp_rr For now i want compare it into one query, so i didi like that, but always there's no result, i think theres somethings wrong where i put the variables values in sql:
SELECT Service AS [Network], Dart, Co, SUBSTRING(CAST(AVG(tryu) AS NVARCHAR(10)),1,5) + ' %' AS [port] INTO #Temp_r ...

Go to the complete details ...