UFN_SELECTION_CONSTITUENT_ALUMNI

Gets constituents who are alumni.

Return

Return Type
table

Definition

Copy


            CREATE function dbo.UFN_SELECTION_CONSTITUENT_ALUMNI()
            returns table
            as return
                select distinct
                    CONSTITUENT.[ID]
                from
                    dbo.CONSTITUENT
                    inner join dbo.EDUCATIONALHISTORY on CONSTITUENT.ID = EDUCATIONALHISTORY.CONSTITUENTID
                    inner join dbo.EDUCATIONALINSTITUTION on EDUCATIONALHISTORY.EDUCATIONALINSTITUTIONID = EDUCATIONALINSTITUTION.ID and EDUCATIONALINSTITUTION.ISAFFILIATED = 1
                where
                    EDUCATIONALHISTORY.CONSTITUENCYSTATUSCODE = 3; /*Graduated -- from EducationalHistory table*/