Zip Count Report¶
This is a list of all zip codes and how many people match each Zip +2 code. After you create it and run it the first time, you have the option to Add to Menu. This will add it to the blue Toolbar on Search Builder, an Organization, or a Tag.
Create the Report¶
Copy the code below and paste it
into a new SQL Script in your database. The recommended name is
Run this Report¶
If you add this to the blue Toolbar you can create a search and, making sure you have one person per household in the search results, you can generate this Zip Count Report to see how many mail pieces will be in each zip plus 2 area.
You also have the option to Download as Excel.
;WITH zips AS ( SELECT LEFT(dbo.GetDigits(PrimaryZip), 7) zip FROM dbo.People p JOIN dbo.TagPerson tp ON tp.PeopleId = p.PeopleId WHERE LEN(ISNULL(PrimaryZip,'')) > 0 AND @qtagid = tp.Id ) SELECT zip, COUNT(*) [Count] FROM zips GROUP BY zips.zip order by zip