| First Colony | Foster Creek | ||
| A | 25 | 2 | |
| B | 69 | 7 | |
| C | 67 | 2 | |
| D | 39 | 2 | |
| E | 19 | 1 | |
| F | 30 | 0 | |
| G | 39 | 5 | |
| H | 70 | 2 | |
| I | 0 | 0 | |
| J | 30 | 0 | |
| K | 25 | 1 | |
| L | 24 | 1 | |
| M | 66 | 3 | |
| N | 21 | 1 | |
| O | 20 | 0 | |
| P | 40 | 6 | |
| Q | 1 | 0 | |
| R's | 37 | 3 | |
| S's | 86 | 4 | |
| T's | 36 | 1 | |
| U's | 2 | 1 | |
| V's | 6 | 0 | |
| W's | 56 | 4 | |
| X's | 0 | 0 | |
| Y's | 1 | 0 | |
| Z's | 3 | 0 | |
| Totals | 812 | 46 | 858 |
--use this to lookup the CodeIDs for the desired Statusselect *from tblCodeswhere codetypeid = '5'with CampusCte as (select c.contactid, LEFT(c.lastname,1) as [Letter], co.Descriptionfrom tblContacts cjoin tblCodes co on c.Service = co.CodeID--change the number to the CodeID for the desired Status. 56 is default Elexio Member - 100 code.where c.Status in ('56'))
select cc_pivot.letter,-- change inside the [] to the exact campus name as listed in elexio [Main Campus], [2nd Campus], [<Unknown>]from CampusCte ccpivot (count(cc.contactid) for cc.description in (--make these the same as the campus list above. copy and paste from above should work [Main Campus], [2nd Campus], [<Unknown>])) as cc_pivotnot # of households that have Adult members.
with CampusCte as (select distinct a.addressid, LEFT(a.AddressName,1) as [Letter], co.Descriptionfrom tblContacts cjoin tblAddresses a on c.AddressID = a.AddressIDjoin tblCodes co on c.Service = co.CodeIDwhere c.familyposition in ('91','92') and--change the number to the CodeID for the Status. 56 is default Elexio Member code. c.Status in ('56'))
select cc_pivot.letter,-- change inside the [] to the exact campus name as listed in elexio [Main Campus], [2nd Campus], [<Unknown>]from CampusCte ccpivot (count(cc.addressid) for cc.description in (--make these the same as the campus list above. copy and paste from above should work [Main Campus], [2nd Campus], [<Unknown>])) as cc_pivotRobert,
Thank you so much! This works perfectly!
You have been so helpful.