Go to Lookup | SQL Queries or in GoldMine Premium Edition Tools | Filters & Groups then click on the SQL Query Tab. Then, paste in this:
select userid, srectype as Type, count(*) as Number from conthist where srectype in ('A', 'C', 'M') and ondate >= '1/1/2000' and ondate <= '6/30/2008' group by userid, srectype
Change the date range to suite your needs… This counts Appointments (A), Call (C), and Emails (M).
This is a great example of multi-field grouping, and how it can be very useful in SQL Queries.
Don't forget, you can send these results to Excel:
http://www.thegmblog.com/2007/10/the_one_that_didnt_get_away_fi.php
Comments (3)
Hi Chad,
Looks like a nice query. Unfortunately, it's not "taking" in my GoldMine 6.7. Here's the error message:
Invalid use of keyword.
Context: SQLQuery:
select userid, srectype as 'Type', count(*) as 'Count' from conthist where srectype in ('A', 'C', 'M') and ondate >= '6/1/2008' and ondate
1: Line Number: 1
2: Token: ,
BDE Error Cat:Code: [42:18]
BDE: 500 [4/11/1999] GoldMine: 6.70.61214
Thanks !
Posted by Ted Chmura III | June 26, 2008 11:55 AM
Posted on June 26, 2008 11:55
I get the same error as Ted.
Invalid use of keyword.
Context: SQLQuery:
select userid, srectype as 'Type', count(*) as 'Count' from conthist where srectype in ('A', 'C', 'M') and ondate >= '6/1/2008' and ondate
1: Line Number: 1
2: Token: ,
BDE Error Cat:Code: [42:18]
BDE: 500 [4/11/1999] GoldMine: 6.50.40321
Posted by RK | June 26, 2008 11:57 AM
Posted on June 26, 2008 11:57
Yes, I noticed that when I was testing the original query I wrote up in GoldMine Premium on a GoldMine 6.7 dBASE install, so changed it to this:
select userid, srectype as Type, count(*) as Number from conthist where srectype in ('A', 'C', 'M') and ondate >= '1/1/2000' and ondate
Then went ahead and posted the original. I'll change it up now.
Thanks for keeping me honest guys! ;-)
Posted by Chad Smith | June 26, 2008 1:26 PM
Posted on June 26, 2008 13:26