select territoryId, name as territoryName from tbl_ter_territories where ownerid = and fsl_tablecode = and territoryid = and datediff( day, ih.invoiceDate, getDate() ) <= 365 group by cdr.cdr_recordId, cdr.cdr_dstCode, cdr.cdr_dstName order by cdr_dstname --->
Distributor Purchasing
#qryTerritory.territoryName#
#_mfrUOM.unitOfMeasurePlural#
#_deltaCases.deltaPercent##_deltaCases.indicatorCharacter#
Dollars
#_deltaDollars.deltaPercent##_deltaDollars.indicatorCharacter#
startDate="#_calendarVars.tyStartDate#" endDate="#_calendarVars.tyEndDate#" planEndDate="#_calendarVars.tyPlanEndDate#" columnSuffix="_ty"> startDate="#_calendarVars.lyStartDate#" endDate="#_calendarVars.lyEndDate#" planEndDate="#_calendarVars.lyPlanEndDate#" lastMonthRate="#_calendarVars.lastMonthRate#" columnSuffix="_ly" addYearOverYearColumns=true > select sum( annualqty_TY ) as annualqty_TY, sum( annualqty_LY ) as annualqty_LY, sum( annualdollars_TY ) as annualdollars_TY, sum( annualdollars_LY ) as annualdollars_LY from qryDistributors