select dstId, dstName from tbl_DST_Distributors with (nolock) where dstCompanyType = 'P' and exists ( select * from tbl_OPR_ClientOperators with (nolock) where ownerId = dstId and fsltablecode = 'DST' ) select m.ownerId, m.fsltablecode, m.operatorId, #_compareDateExpr# lastActiveDate from tbl_OPR_ClientOperators m with (nolock) where m.ownerId = and m.fsltablecode = 'DST' and nullif( m.fsl_choId, 0 ) is null and datediff( month, #_compareDateExpr#, getDate()) > #_inactiveMonthThreshold# and m.crmActive = 'Y' and m.oprCompanyType = '0' and nullif( m.mfrCustNum, '' ) is not null select m.ownerId, m.fsltablecode, m.operatorId, #_compareDateExpr# lastActiveDate from tbl_OPR_ClientOperators m with (nolock) where m.ownerId = and m.fsltablecode = 'DST' and nullif( m.fsl_choId, 0 ) is null and datediff( month, #_compareDateExpr#, getDate()) <= #_inactiveMonthThreshold# and m.crmActive = 'N' and m.oprCompanyType = '0' and nullif( m.mfrCustNum, '' ) is not null update tbl_OPR_ClientOperators set crmActive = 'N', crmActiveDate = coalesce( crmActiveDate, coalesce( dateCreated, dateadd( month, -1, ) )), crmDeactiveDate = , crmActiveReason = where ownerId = and fsltablecode = and operatorId = update tbl_OPR_ClientOperators set crmActive = 'Y', crmActiveDate = , crmDeactiveDate = null, crmActiveReason = null where ownerId = and fsltablecode = and operatorId =

Delivery Locations Status Processor

All 1FS library accounts for Distributor HQs were processed as follows:

  1. Any unmapped delivery location that have been inactive more than #_inactiveMonthThreshold# months is deactivated
  2. Any unmapped delivery location thas has become active within the past #_inactiveMonthThreshold# months has been activated.
The date of last activity used to determine activation is the "freshness date" or if that is not available the date the record was created.


Delivery Location Activation/Deactivation due to Activity
DistributorDeactivate CountActivate Count
#htmleditformat( _locations[ dstId ].name )# #_locations[ dstId ].deactivateCount# 0 #_locations[ dstId ].activateCount# 0

select m.fsl_choId, m.mfrCustNum, m.companyName, #_compareDateExpr# lastActiveDate from tbl_OPR_ClientOperators m with (nolock) where m.ownerId = and m.fsltablecode = 'DST' and m.operatorId =
#htmleditformat( _locations[ dstId ].name )#'s Deactivated Locations (#_locations[ dstId ].deactivateCount#)
Acct ## Operator Last Active Days Inactive
#htmleditformat( qmd_operator.mfrCustNum )# #htmleditformat( qmd_operator.companyName )# #lsdateformat( qmd_operator.lastActiveDate, 'mm/dd/yyyy' )# #datediff( 'd', qmd_operator.lastActiveDate, Now() )#

select m.fsl_choId, m.mfrCustNum, m.companyName, #_compareDateExpr# lastActiveDate from tbl_OPR_ClientOperators m with (nolock) where m.ownerId = and m.fsltablecode = 'DST' and m.operatorId =
#htmleditformat( _locations[ dstId ].name )#'s Activated Locations (#_locations[ dstId ].activateCount#)
Acct ## Operator Last Active Days Inactive
#htmleditformat( qmd_operator.mfrCustNum )# #htmleditformat( qmd_operator.companyName )# #lsdateformat( qmd_operator.lastActiveDate, 'mm/dd/yyyy' )# #datediff( 'd', qmd_operator.lastActiveDate, Now() )#