select L2.catalogId prodID, L2.catalogCode product, L2.catalogDesc shortdesc
from tbl_DW_ProductHierarchyPaths#_tableSuffix# L2 with (nolock)
where L2.OwnerID =
and L2.OwnerType =
and L2.crmactive = 'Y'
and L2.catalogType = 'PRD'
and exists (select L1.skuId
from tbl_DW_ProductHierarchy#_tableSuffix# L1 with (nolock)
where L1.prodId = L2.catalogId
and L1.crmActive = 'Y'
and L1.discontinued =
)
order by shortdesc
select L3.catalogCode category, L3.catalogId categoryid
from tbl_DW_ProductHierarchyPaths#_tableSuffix# L3 with (nolock)
where L3.OwnerID =
and L3.OwnerType =
and L3.catalogType = 'CAT'
and exists (select skuid
from tbl_prd_skus sku with (nolock)
inner join tbl_prd_products prd with (nolock)
on prd.prodid = sku.prodid
and prd.categoryid = L3.catalogId
where sku.crmActive = 'Y'
and sku.inactive = 0
and sku.discontinued =
)
order by category
select distinct cs.customertype, cs.customerID, cdr_dstname as dstname
from tbl_PRD_CustomerSkus cs with (nolock)
inner join tbl_CDR_Distributors cdr with (nolock)
on cdr.cdr_recordid = cs.customerid
and cdr.ownerid =
and cdr.fsl_tablecode =
where cs.OwnerID =
and cs.FSL_TableCode =
and ( cs.customertype = 'pdst' or cs.customertype = 'dst' )
union
select distinct 'G' as customertype, s.dst_id customerID, cdr_dstname as dstname
from tbl_PRD_Skus s with (nolock)
inner join tbl_CDR_Distributors cdr with (nolock)
on cdr.cdr_recordid = s.dst_id
where s.FSL_TableCode =
and s.OwnerID =
and s.inactive = 0
and cdr.FSL_TableCode =
and cdr.OwnerID =
and cdr.cdr_dstCompanyType = 'G'
order by cdr.cdr_dstname
select foodservice_rewards, star_awards, value_plus, cool_school, brand_points_plus, real_rewards_cafe
from tblManufacturers where mfr_id =
select 'Y' foodservice_rewards, 'Y' star_awards, 'Y' value_plus, 'Y' cool_school, 'Y' brand_points_plus, 'Y' real_rewards_cafe
select distinct cho.cho_id, cho.cho_name, cho.cho_dbaname, cho_type
from tbl_opr_clientoperators opr with (nolock)
inner join tbl_cho_operators cho with (nolock)
on cho.cho_id = opr.fsl_choid
and cho.cho_type in ('g','c')
where opr.operatorid in (
select distinct affiliationorgid
from tbl_CRM_AffiliationProducts
where ( startdate is null or startdate <= getdate() )
and ( enddate is null or enddate >= getdate() )
)
and opr.fsltablecode = 'mfr'
order by cho.cho_name
select distinct opr.operatorid affiliateId, opr.companyname affiliateName
from tbl_CRM_AffiliationProducts ap with (nolock)
inner join tbl_OPR_ClientOperators opr with (nolock)
on opr.OperatorID = ap.affiliationOrgID
and opr.OwnerID =
and opr.FSLTableCode =
and ap.skuid > 0
and ( ap.startdate is null or startdate <= getdate() )
and ( ap.enddate is null or enddate >= getdate() )
and ap.linkType = 'MFR'
and ap.linkid in ()
order by opr.companyname
checked type="checkbox" name="showDiscontinued" id="showDiscontinuedChkbx" data-theme="#request.jqmUI.formElement#" data-mini="true" />
checked type="checkbox" name="excludePrivateLabel" id="excludePrivateLabelChkbx" data-theme="#request.jqmUI.formElement#" data-mini="true" />
select privateLabelPartnerTypeLabel, brand, brand_id from qryAllBrands order by privateLabelPartnerTypeLabel, brand
select distinct tcl.tradechannel, tl.label
from tbl_PRD_TradeChannelLink tcl
inner join tbl_PRD_TradeChannels tl
on tl.codeValue = tcl.tradeChannel
where tcl.ownerId =
and tcl.ownertype = >Trade Channel: #htmleditformat(label)#
select distinct
pl.listId as productSetId,
pl.listName as productSetName,
'##' + replace( replace( replace( replace( replace( ltrim( rtrim( pl.listName )), ' ', '_' ), '##', '_' ), '''', '_' ), ';', '_' ), ',', '_' ) + ';' as productSetTag
from tbl_lst_partnerlists pl with (nolock)
inner join tbl_lst_partnerlistaccess pla with (nolock)
on pla.listid = pl.listid
and exists (select * from tbl_lst_partnerlistaccess sq_pla with (nolock)
where listid = pla.listid )
and ( not exists (select * from tbl_lst_partnerlistaccess sq_pla with (nolock)
where listid = pla.listid
and subjecttype = 'grp-ud')
or exists (select * from tbl_lst_partnerlistaccess sq_pla with (nolock)
where listid = pla.listid
and subjecttype = 'grp-ud'
and subjectid in ()) )
and ( not exists (select * from tbl_lst_partnerlistaccess sq_pla with (nolock)
where listid = pla.listid
and subjecttype = 'grp-sh')
or exists (select * from tbl_lst_partnerlistaccess sq_pla with (nolock)
where listid = pla.listid
and subjecttype = 'grp-sh'
and subjectid in ()) )
where pl.ownerid =
and pl.ownertype =
and pl.partnertype = 'SKU'
and getdate() >= pl.publishdate
and getdate() <= pl.unpublishdate
order by pl.listName