#_toggleBarHTML#
select distinct territoryId, parentTerritoryId
from request.qmd_userTerritoryHierarchy
where localmarket = 1
select territoryId, coalesce( salesBrokerVisibilty, 'NONE' ) salesBrokerVisibilty
from tbl_TER_Territories
where ownerId =
and fsl_tablecode = 'MFR'
and territoryId in ( )
select territoryId, parentTerritoryId, territoryName, localMarket, internalSalesId
from request.qmd_userTerritoryHierarchy
where localMarket = 1
select b.broker_id, b.broker_name, case when b.broker_id = 14 then 'Y' else b.crmCustomerFlag end crmCustomerFlag
from tbl_SMA_BrokerOfficeLink sma
inner join tblBrokers b
on b.broker_id = sma.brokerId
where sma.mfr_id =
and sma.territoryId =
and sma.primaryOffice = 'Y'
select *, upper( brokerName ) brokerNameSort, upper( territoryName ) territoryNameSort
from qmd_brokers
order by brokerNameSort, territoryNameSort
Territory
Broker Sales Visibility
#htmleditformat( brokerName )#(Food Service CRM)Unassigned