select dotCode, gtin, stockingstatus
from tbl_DOT_StockingStatus d
inner join tbl_PRD_Packaging pack ON pack.scc14 = d.gtin
where pack.ownerid =
and pack.fsl_tableCode =
and pack.linkType = 'SKU'
and pack.linkID = ;
select distinct c.customerSku, rtrim(d.cdr_dstname) AS CustomerName
from tbl_PRD_CustomerSkus c
inner join tbl_CDR_Distributors d ON (c.customerID = d.cdr_recordid)
inner join tbl_PRD_SKus s ON s.sku = c.sku and c.linkType = 'SKU'
where c.OwnerID =
and c.FSL_TableCode =
and d.OwnerID =
and d.FSL_TableCode =
and (c.CustomerType = 'DST' OR c.CustomerType = 'PDST')
and rtrim(c.sku) <> rtrim(CustomerSku)
and s.skuid =
order by CustomerName, CustomerSku
select affiliationOrgId, affiliationType, status, startDate, endDate, comment
from tbl_CRM_AffiliationProducts
where ( skuId =
or ( linkId = and linkType = 'SKU' ))
select *
from qmd_specifiedSKUs
where affiliationName is not null
order by affiliationName
#writeAttributeValue("DOT Status", replacenocase(qry_getStockingStatus.stockingstatus,"Stock","Stocked"))#
#writeAttributeValue("DOT Code", qry_getStockingStatus.dotCode)#