Posted on 2013-05-20
Hi Everyone, I am trying to fill a need and I think the best way to do it may be a stored procedure.
So... I have this query which pulls back data. This query runs fine.
select a.household, a.record_id, a.FirstName, a.LastName, b.MemberStatus from tblPeopleMain As a, tblPeopleChurchInfo b Where Not Exists (Select HouseHold, AmountPledged from tblPledgesN As c Where a.HouseHold = HouseHold And PledgeYear = '2013' and AmountPledged <> 0) AND a.FamilyPos = 'Head' and b.PeopleID = a.RecordID and b.MemberStatus = 'Active' order by LastName asc
From the data that returns I then want to add a column called Contributed2013 and for each record above see if the person contributed in 2013 by running this query and adding a Y or a N in the column I added.
Select Amount from tblContributionN where record_idreturnedfromabove = PeopleID and Amount <> 0
If it returns a record or multiple records I want it to put a Y in the column.
Any help formulating this would be great. I am thinking it is pretty easy for most of you! Thanks in advance.