Member Type in Org¶
This report allows you to specify an Organization Member Type in the script and then run the report from the blue Toolbar on the Organization > Search page for a filtered list of Orgs.
Notice in the sample below, that this is a great report to use when you need to easily find out which Organizations do not have someone with that specific Member Type.
Use the following code to Create the SQL Script. See How to create a SQL Script.
In the script below, the top DECLARE statement is where you will enter the specified Member Type. In our example, the Member Type in the Org is Missions Leader. Just replace Missions Leader with the appropriate Member Type.
Note
You can create multiple scripts if you need them for more than only Member Type and name them appropriately. In the sample, the name of the script is MissionsLeaderInOrg. If you plan to add this to the Org Search Toolbar, you will want to include in the name of the script the Member Type you used.
DECLARE @membertype VARCHAR(50) = 'Missions Leader'
SELECT
LinkForNext = '/Org/' + CONVERT(VARCHAR(25), o.OrganizationId)
,o.OrganizationName
,LinkForNext = '/Person2/' + CONVERT(VARCHAR(25), p.PeopleId)
,Name = p.Name2
,om.MemberType
FROM dbo.Organizations o
LEFT JOIN dbo.CurrOrgMembers(@orgids) om ON o.OrganizationId = om.OrganizationId AND om.MemberType = @membertype
LEFT JOIN dbo.People p ON p.PeopleId = om.PeopleId
WHERE o.OrganizationId IN (SELECT Value FROM dbo.SplitInts(@orgids))
ORDER BY o.OrganizationName, p.Name2
Latest Update |
11/13/2020 |
Modify image link with secure protocol.