I have a table of "leads" I need to report on....
The leads are broken down into
I need to report on HOW many Current Client Referrals, Past Client Referals, Advertising Leads, etc. came in for a given time period
What's the most efficient way to count how many of each would be in a table?
Essentially looking for a SQL count function WHERE the field is LeadTypeID
Thanks in advance for any help!
ExecuteSQL ( "
SELECT leadSource, COUNT ( leadSource )
leadTypeID = ? AND
theDate >= ? AND theDate <= ?
GROUP BY leadSource
" ; ": " ; "" ; $leadTypeID ; $dateBegin ; $dateEnd