Sage SalesLogix
  • Contact Us
  • Sage North America
800-643-6400
Welcome Twitter Facebook LinkedIn

Building Groups With SQL Statements

by ajappel on 12-09-2011 06:59 AM - last edited 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




Labels