OMG!!! I am sorry for the silly answer. While posting answer, I never realized, delete statement is not allowed in scalar functions. As suggested...
CREATE FUNCTION delUserGrp (@name nvarchar(15))
DECLARE @RETVAL INT
IF NOT EXISTS (SELECT *
, Round(Sum((CASE WHEN Month(BatchDateTime) = 7 THEN Amount ELSE 0 END)*-1),0) AS July
, Round(Sum((CASE WHEN...
Refer this link
Separate names with a comma.