Hello All, I would like to know why I am getting the following msg in my SQL statement and how to resolve itHere is the code:RETURNS real AS BEGIN RETURN (SELECT dbo.EDCDet.EDID , dbo.EDCDet.Shot , Sum(dbo.EDCDet.HoleNumber) AS 'HoleSum' FROM dbo.EDCDet GROUP BY dbo.EDCDetails.EDCDetailsID, dbo.EDCDet.Shot) END
Here is the Error msg: Msg 116, Level 16, State 1, Procedure fx_TotalHole, Line 25Only one expression can be specified in the select list when the subquery is not introduced with EXISTS.I currently have this set up as a scalar function. A colleague recommended that I take this approach rather than making this a storedprocedure but would not elaborate as to why and I hate being in the dark about things.