SQL Learning Center - GoldMine

Use SQL queries to get answers from GoldMine

May 28, 2008

Search for History Logged Field Updates

by @ 11:18 am. Filed under MSSQL History

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.

  1.  
  2. SELECT
  3.  c1.contact
  4. ,c1.company
  5. ,c1.city
  6. ,c1.STATE
  7. ,c1.key4
  8. ,ch.REF
  9. ,ch.createon
  10. ,c1.accountno
  11. FROM
  12.  contact1 c1 (NOLOCK)
  13.  JOIN conthist ch
  14.  ON c1.accountno=ch.accountno
  15. WHERE
  16.  ch.createon > '06/01/2006'
  17.  AND ch.resultcode= 'LOG'
  18.  AND SUBSTRING(ch.REF,28,3) = 'DCS'
  19.  AND SUBSTRING(ch.REF,37,3) = 'KES'
Bookmark:

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • del.icio.us
  • Live
  • Google
  • Facebook
  • bodytext
  • StumbleUpon
  • Slashdot

Leave a Reply

You must be logged in to post a comment.

GoldMine SQL Tutorial:

General SQL Tutorials:

SQL Help Links:

Recommended Reading - SQL Books:

RSS:

Links:

Search For SQL Query:

GoldMine MS SQL Queries:

GoldMine dBase SQL Queries (LocalSQL):

22 queries. 0.086 seconds