Skip to Content
Former Member
Mar 07, 2011 at 03:31 PM

Calculating One Value from Three Possible Values


I want to generate a list of customer phone numbers to call from a database. A customer may have a primary phone number, a business phone number, and a cell phone number. I only want one to call one phone number from each customer. If the primary phone number is available, then it should be on the list. If the primary number is blank or 999-999-9999, then list the business phone number instead. If the business phone number is blank or 999-999-9999, then call the cell number instead. If the cell number is blank or 999-999-9999, then don't list the customer at all.

Also, only list distinct phone numbers so that the same phone number isn't called more than once.

I've tried various approaches, but can't get this work. Any ideas on how I should attack this?