Originally posted by MarillionFan
Know-it-all!!!
SELECT accountno FROM contsupp WHERE rectype = 'p' AND CAST(SUBSTRING(city,9,8) AS datetime)between '01/01/2006' and '04/30/2007' AND (contact LIKE '%Focus%' or contact LIKE '%Training%' or contact LIKE '%Course%' or contact LIKE '%HDI%' or contact LIKE '%Executive Forum%' or contact LIKE '%Benchmark buddy%' or contact LIKE '%Committee%' or contact LIKE '%Consultancy%' or contact LIKE '%Helpline%' or contact LIKE '%Leadership%' or contact LIKE '%Site Aud%' or contact LIKE '%Site Ass%' or contact LIKE '%Site Re%') UNION ALL SELECT accountno FROM GMSM_GMBASE.dbo.cal WHERE rectype = 'S' GROUP BY accountno HAVING COUNT (accountno) > 2;
Leave a comment: