select name from tbl_TER_Territories with (nolock) where ownerId = and fsl_tablecode = and territoryId = select unitOfMeasurePlural, planningMethod from tblManufacturers where mfr_id = select groupID from tbl_SEC_Groups with (nolock) where GroupTypeCD = 'MRR' and ownerid= 0 and FSL_TableCode = 'SYS' and ( groupname = 'Distributor Management' or groupname = 'Operator Selling' ) select distinct tm.teamMemberUserId, m.firstName, m.lastName from tbl_TER_TeamMembers tm with (nolock) inner join tbl_TER_TeamMembers mm with (nolock) on mm.territoryId = tm.territoryId inner join tbl_FSPRO_Members m with (nolock) on m.fspro_userid = tm.teamMemberUserId and m.ownerId = tm.ownerId inner join tbl_SEC_MemGrpLink ml with (nolock) on ml.FSPro_UserID = tm.teamMemberUserId and ml.groupId in ( ) where tm.territoryId in ( ) and tm.ownerId = and tm.ownerType = -- and tm.teamMemberRole = 'TeamMember' order by lastName, firstName select distinct tm.teamMemberUserId, m.firstName, m.lastName from tbl_TER_TeamMembers tm with (nolock) inner join tbl_TER_TeamMembers mm with (nolock) on mm.territoryId = tm.territoryId inner join tbl_FSPRO_Members m with (nolock) on m.fspro_userid = tm.teamMemberUserId and m.ownerId = tm.ownerId where tm.territoryId in ( ) and tm.ownerId = and tm.ownerType = and tm.teamMemberRole in ( 'PrimaryManager', 'SecondaryManager', 'TeamManager' ) order by lastName, firstName select teamMemberRole from qmd_teamMembers where teamMemberUserId = and teamMemberRole like 'MPR:%' select * from qmd_stages where statusCode = 'A' order by likelihoodpercent select * from qmd_stages where statusCode = 'C' order by likelihoodpercent select spl.opportunityId, spl.stageId, spl.availableDate, spl.updateDate, opr.territoryId territoryId, spl.salesPersonUserId, spl.caseAmt, spl.incomeAmt, spl.weightAmt, spl.fsePlanTerritoryId, spl.fseAcctTerritoryId from tbl_SPL_Opportunities spl with (nolock) inner join tbl_OPR_ClientOperators opr with (nolock) on opr.operatorId = spl.partnerId where spl.ownerId = and spl.ownerType = and spl.stageId in ( ) and ( spl.fsePlanTerritoryId in ( ) andor spl.salesPersonUserId in ( ) ) and spl.availableDate between '#lsdateformat( _fiscalPeriodRange.from, "YYYY-MM-DD")#' and '#lsdateformat( dateadd( "d", 1, _fiscalPeriodRange.to ), "YYYY-MM-DD" )#' and spl.partnerType = 'OPR' and spl.typeCode <> 'PRO' and opr.crmActive = 'Y' and spl.mfrId in ( ) and ( spl.salesPersonUserId in ( ) or ( nullif( spl.salesPersonUserId, 0 ) is null and opr.mfr_bsr_id = ) ) union select spl.opportunityId, spl.stageId, spl.availableDate, spl.updateDate, cdr.cdr_territoryId territoryId, spl.salesPersonUserId, spl.caseAmt, spl.incomeAmt, spl.weightAmt, spl.fsePlanTerritoryId, spl.fseAcctTerritoryId from tbl_SPL_Opportunities spl with (nolock) inner join tbl_CDR_Distributors cdr with (nolock) on cdr.cdr_recordId = spl.partnerId where spl.ownerId = and spl.ownerType = and spl.stageId in ( ) and ( spl.fsePlanTerritoryId in ( ) andor spl.salesPersonUserId in ( ) ) and spl.availableDate between '#lsdateformat( _fiscalPeriodRange.from, "YYYY-MM-DD")#' and '#lsdateformat( dateadd( "d", 1, _fiscalPeriodRange.to ), "YYYY-MM-DD" )#' and spl.partnerType = 'CDR' and spl.typeCode <> 'PRO' and cdr.crmActive = 'Y' and spl.mfrId in ( ) and ( spl.salesPersonUserId in ( ) or ( nullif( spl.salesPersonUserId, 0 ) is null and cdr.mfr_bsr_id = ) ) select min( availableDate ) eodFrom, max( availableDate ) eodTo from qmd_opportunities select sum( caseAmt ) cases, sum( weightAmt ) lbs, sum( incomeAmt ) dollars, count(*) opportunityCount from qmd_sales select distinct fsePlanTerritoryId from qmd_opportunities ---> select name from tbl_TER_Territories with (nolock) where ownerId = and fsl_tablecode = and territoryId = select firstName, lastName from tbl_FSPro_members with (nolock) where ownerId = and fsl_tablecode = and fspro_userid = where ownerId = and fsl_tablecode = and fspro_userid =

#htmleditformat( _title )#

#_chartHTML# #_viewHTML#

Sold Opportunities



Yearly Amount
 
 
 
initializing...
 
select * from qmd_principals order by mfrName
 
select teamMemberRole, territoryId from tbl_TER_TeamMembers with (nolock) where teamMemberUserId = and teamMemberRole <> 'TeamMember' and ( territoryId in ( ) or territoryId in ( select parentTerritoryId from tbl_TER_Territories where territoryId in ( ) ) ) and ownerId = and ownerType =
 
select distinct teamMemberUserId, firstName, lastName from qmd_teamMembers order by lastName, firstName