18
Answers

Getting same average values excute the stored procedure

Sivakumar

Sivakumar

9y
601
1
Hi,
 
This is My Stored Procedure :
 
GO
/****** Object: StoredProcedure [dbo].[uspGetVote] Script Date: 9/3/2015 12:40:42 PM ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROCEDURE [dbo].[uspGetVote](@TeamID INT)

AS

BEGIN


select avg(VoteValue) as [AverageVoteValue] from Vote where datediff(day,getdate(),LastModifiedDateTime) <= 7 Group By TeamID order by AverageVoteValue

END 
 
and i execute this procedure but get a same results for all teamid's 
 
please give a correct query for that
Answers (18)