How to query on Postal Codes that only have 5 digits

Postal codes can be either 5 digits (like: 12345) or 5 + 4 digits (like: 12345-6789) and sometimes we would like to find those with only 5 digits to update them. 

To find all accounts with a Postal Length of only 5 digits we will hava to do a compound query.

1st Query (to include everyone that has a postal code):
1) Query Category: Base / Query: All Accounts - A
2) Data Return Type: Accounts
3) Criteria Options: Match each critieria
4) Select Any Persona
5) Criteria: Postal Code: Mark box - Field has any Value

2nd Query (to include everyone that has more than 5 digits in Postal Code):
1) Query Category: Base / Query: All Accounts - A
2) Data Return Type: Accounts
3) Criteria Options: Match each critieria
4) Select Any Persona
5) Criteria: Postal Code Length: Greater Than or Equal to 6

3rd Query - Compound Query (to only show those that have 5 or less digits in their Postal Code):
1) Data Return Type: Accounts
2) Select Compound Type: Subtract Query 2 from Query 1
3) Query 1: Select the 1st query you created (All Postal Codes)
4) Query 2) Select the 2nd query you created (Postal Codes 6+ digits)
5) Save and Preview

Environment

 eTapestry

Was this article helpful?