select firstName, lastName, email from tbl_FsprO_members where fspro_userid = and ownerId = and fsl_tablecode = select cdr.cdr_recordId, ter.territoryId, ter.name territoryName from tbl_CDR_Distributors cdr inner join tbl_TER_Territories ter on ter.territoryId = cdr.cdr_territoryId where cdr.mfr_bsr_id = and cdr.ownerId = and cdr.fsl_tablecode = and cdr.crmActive = 'Y' select stageId from qmd_stages where statusCode = 'A' select stageId from qmd_stages where statusCode = 'C' select p.cdr_recordId partnerId, p.cdr_dstName partnerName, cls.name classificationName, 0.0 SoldDollars, 0.0 ActiveDollars, ter.territoryId, ter.name territoryName from tbl_CDR_Distributors p inner join tbl_TER_TErritories ter on ter.territoryId = p.cdr_territoryId left outer join tbl_CDR_CLassifications cls on cls.classificationId = p.classificationId where p.cdr_recordId in ( ) and not p.cdr_recordId in ( ) select opportunityId, territoryName, partnerId, partnerName,classificationName, incomeAmt SoldDollars, 0.0 ActiveDollars from qmd_rawOpportunities where stageId in ( ) union select opportunityId, territoryName, partnerId, partnerName, classificationName, 0.0 SoldDollars, incomeAmt ActiveDollars from qmd_rawOpportunities where stageId in ( ) union select partnerId opportunityId, territoryName, partnerId, partnerName, classificationName, SoldDollars, ActiveDollars from qmd_voids select territoryName, partnerId, partnerName, classificationName, sum( SoldDollars ) SoldDollars, sum( ActiveDollars ) ActiveDollars from qmd_opportunityXtab group by territoryName, partnerId, partnerName, classificationName order by ActiveDollars desc, SoldDollars desc select territoryName, count(*) operatorCount from qmd_opportunitySummaryRaw group by territoryName order by operatorCount desc select * from qmd_opportunitySummaryRaw where territoryName = order by ActiveDollars desc, SoldDollars desc select sum( SoldDollars ) SoldDollars, sum( ActiveDollars ) ActiveDollars from qmd_opportunitySummary
Distributor Business Plan Ranking Detail
#htmleditformat( qmd_territories.territoryName)#: #qmd_opportunitySummary.recordCount# of #qmd_opportunitySummaryRaw.recordCount# Accounts
Distributor Classification Sold Dollars Active Dollars
Total for #htmleditformat( qmd_memberLookup.firstName )# #htmleditformat( qmd_memberLookup.lastName )#   #rereplace( lscurrencyformat( round( val( qmd_totals.SoldDollars ) )), "\.\d\d$", "" )# #rereplace( lscurrencyformat( round( val( qmd_totals.ActiveDollars ) )), "\.\d\d$", "" )#
#htmleditformat( partnerName )# #htmleditformat( classificationName )# #rereplace( lscurrencyformat( round( val( SoldDollars ))), "\.\d\d$", "" )# #rereplace( lscurrencyformat( round( val( ActiveDollars ))), "\.\d\d$", "" )#
Options used for this Report
Customer Manager: #htmleditformat( qmd_memberLookup.lastName )#, #htmleditformat( qmd_memberLookup.firstName )# <#htmleditformat( qmd_memberLookup.email )#>
Manufacturer: All Manufacturers #htmleditformat( qmd_principal.mfrName )#
Run By: #htmleditformat( client.user )# <#trim( htmleditformat( client.email ))#>