Adimpact.com

How to Find All Contacts in Several States

July 9, 2009

in SQL Query

7-9-2009-9-11-51-pmHope everyone is having a great summer!

Here’s a handy SQL query that might be a introduction to the ‘in’ statement for many of you.  This example will quickly find all the contacts in several different states without stringing together multiple ‘or’ statements.

select company, contact, source, key1, STATE, createon from contact1
where state in ('MA', 'NH', 'VT', 'CT', 'ME', 'RI')
order by state, company

To use this, from GoldMine’s main menu choose Lookup | SQL Queries then copy & paste the above in the top section then click Query.  If you are using GoldMine Premium Edition then Tools | Filters & Groups and then the SQL Query tab.

Changing which states will be list is as easy as changing what’s between the “(” and “)”.

sql-query-for-goldmine

Previous post: Top 10 Reasons to Upgrade to GoldMine Premium Edition 8.5

Next post: GoldMine 8.5.1 Release