Hi everyone,
Here's what I'm trying to do, I want to select the COUNT value from table2 where it should match the ID from table1.
But this is the value i get, and it's applied for the entire column. What I need is to display is the COUNT value row per row WHERE table1.ID = table2.ID.
Any help would be much appreciated, and thanks in advance.
I'm using SQL Server 2008 and here's my query:
declare @tally int
set @tally=(
SELECT COUNT(m.transmittal_ID)
FROM Received_Forms rf INNER JOIN Member m ON rf.transmittal_ID = m.transmittal_ID
GROUP BY rf.transmittal_ID
)
select
rf.received_forms_id
,rf.transmittal_ID
,rf.source
,rf.nutriAdvocates_name
,rf.nutriAdvocates_doctor
,rf.nutriAdvocates_area
,rf.nutriAdvocates_actual_retrieved_date
,rf.received_by
Go to the complete details ...