Use SQL queries to get answers from GoldMine
Type: MSSQL
Description: This query will give you counts for a list of Contact Types you give it in the WHERE portion
Type: MSSQL
Description: In this more advanced query we see the following scenario: You suspect that some contacts have been deleted from GoldMine when instead they should have been moved to your Archive Database. We move contacts flagged for deletion to a database called GoldMine_Archive. In this query we check for GoldMine accountnos in an older backup that weve restored to an alternate MSSQL database GoldMine_20070806 against all the accountnos in both the current GoldMine and GoldMine_Archive.
Type: MSSQL
Description: This query returns email records for a contact that have keywords in the body of the email. In the example below we are looking for emails that contain the words “Subscription”, “Offering”, “Document ” or “Documents “. Notice the trailing space after the document and documents examples.
Type: MSSQL
Description: In this query we are searching for history records that were logged by GoldMine (because create a history log record for updates is checked in the field setup). In this particular case we are looking for key4 when it was changed from ‘DCS’ to ‘KES’ after June 1st 2006.
Note: This query needs to be rewritten using PATINDEX to account for varying start postions. In this case it works because all Rep IDs are 3 character.
Type: MS SQL Query
Description: This gives you a count by user for the calls they created a history for. In this case I limited the date range to the year 2007.
Description: This query returns all histories added to GoldMine in the past 30 days.
What I liked about Judith Bowman’s “The Practical SQL Handbook” is that it’s easy to read and the examples aren’t difficult to try yourself. It starts with an explanation of how the SQL language was developed and why the developers designed it as they did. It’s not specific to any single SQL implementation but intead covers aspects of the Query Language that are common to all SQL implementations. If you are completely new to SQL you should try one of the books categorized here as Beginner but this book should be your second SQL read.
This is the book I’ve turned to when I’m up against a very challenging request for either a query or a script. It’s written in a very straightforward manner. Every code example, there are over 600, is relevant to what Ken is explaining. There is no fluff in this book whatsoever.
Categories: Contact, Email
Description: This returns all emails for a mergecode specified in the WHERE portion of the query between the percent signs for both primary and additional contact email addresses.
Type: MS SQL
Categories: Contact, Email
Description: This returns contact information along with the primary email address for those contacts that have a value in the email mergecode which is specified in the WHERE portion of the query at cs.mergecodes LIKE ‘%Put mergecode between these percent signs%’. The % sign allows you to search of that value anywhere in the mergecode field.
21 queries. 0.177 seconds