XopherS
Technical User
- Dec 8, 2006
- 35
This is... convoluted.
I have a customer database in GoldMine.  I want to get all old customers so that I may deactivate them.  Criteria for "old":
- If they do not have any *call* activities in the History tab, then the created date should be 12/31/2002 or earlier.  (We've arbitrarily decided on a four-year oldness date.)
- If they do have *call* activities, then the most recent activity *for our supported products* should be no later than 12/31/2002.
I'm working this in SQL, so here's the tables/fields information:
- contact1:
-- accountno
-- contact
-- createon
- conthist:
-- srectype
-- createon
-- actvcode
Restrictions:
- where srectype = 'C' [for Call]
- where createon < '1/1/2003' [in either table]
- where actvcode <> 'RYL' [the code for the nonsupported product]
Where do I even begin?
I have a customer database in GoldMine.  I want to get all old customers so that I may deactivate them.  Criteria for "old":
- If they do not have any *call* activities in the History tab, then the created date should be 12/31/2002 or earlier.  (We've arbitrarily decided on a four-year oldness date.)
- If they do have *call* activities, then the most recent activity *for our supported products* should be no later than 12/31/2002.
I'm working this in SQL, so here's the tables/fields information:
- contact1:
-- accountno
-- contact
-- createon
- conthist:
-- srectype
-- createon
-- actvcode
Restrictions:
- where srectype = 'C' [for Call]
- where createon < '1/1/2003' [in either table]
- where actvcode <> 'RYL' [the code for the nonsupported product]
Where do I even begin?