Showing results for 
Search instead for 
Do you mean 

Building Groups With SQL Statements

by on ‎12-09-2011 06:59 AM

I was asked to build a group that showed all Accounts that had been converted to Leads and had NOT been assigned a Leadsource.  In the customer's system they had created two custom fields- Lead.QualifiedBy which populated Account.QualifiedBy during the Lead conversion process. 


Add in the following conditions under Accounts to build the group-

Not ( Field Operator Value ) And/Or
  ( Account.QualifiedBy does contain data     AND
X   Account.Contact.Contactid in (select contactid from contact_leadsource) ) END



This creates the following SQL syntax:

SELECT [list of fields in group's layout] WHERE (A1.QUALIFIEDBY IS NOT NULL AND A1.QUALIFIEDBY <> '') AND (A3.CONTACTID IN (select contactid from contact_leadsource)) ORDER BY A1.ACCOUNT_UC ASC

Register Read Guidelines Request Partner or Employee Access

What's New in 8.1