3
Answers

stored procedure returns Null value

Sivakumar

Sivakumar

9y
475
1
Hi,
 
This is My storedprocedure :
 
GO
ALTER PROCEDURE [dbo].[uspGetVote](@TeamID INT,@CardID INT)

AS

BEGIN


SELECT AVG(VoteValue) AS [AverageVoteValue] FROM Vote
WHERE TeamID=@TeamID and CardID=@CardID and LastModifiedDateTime between getDate()-7 and getDate()
end 
 
When execute this procedure returns Null.
 This is my table values :
 
 
 
When i pass TeamID and CardID 1,1 its shows a Null.
 
Please give a correct query for that.
Thank You.
Answers (3)