New feature! Upgrade and increase expert visibility of your issues with Priority Questions.
DECLARE @fromdt AS datetime DECLARE @todt AS datetime SET @fromdt = '7/1/2014' SET @todt = '7/31/2014' select * from tblOrgRegistrations as r JOIN tblOrgHours as h ON h.RegID = r.regid Where r.AgencyID = 74 And (h.ActivityDate >= @fromdt And h.ActivityDate <= @todt) Group By r.Agency
Msg 8120, Level 16, State 1, Line 5 Column 'tblOrgRegistrations.RegID' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.