Description
To get facings and sessions from the Asset Purity Table
Query :
To get facings and sessions from the Asset Purity Table
Query :
Select a.UPC, * from vwProductList a where a.ClientId = '77' and a.UPC Like '99999%' order by a.SKU asc select Convert(char(10),AP.CreatedOn,126)'Date',AP.ClientId,C.ClientName,SceneTypeId,SceneTypeCategory,AP.SceneTypeCode,SceneTypeName,AP.SceneSubTypeCode,AP.SessionUid,AP.SceneUid,AP.SceneId,AP.StatusId,AP.SelfCheck,APP.productId IRProductId,D.Product IRProductName,D.SKU IRSKUId,RESkuCode,D.RESKUDescription,OrientationID,D.Type,D.SellingPackFrontFacings,D.SellingPackSideFacings,AP.ImageCount,IsIRQueued,AP.GroupId,BlockNumber,Shelf,Position,AP.ReportURL,count(APP.ProductId) as Facings_Count from vwAssetPurityList AP with (nolock) full outer join AssetPurityProduct APP with (nolock) on AP.AssetPurityId=APP.AssetPurityId join Client C with (nolock) on AP.ClientId=C.Clientid full outer join vwProductList D with (nolock) on APP.ProductID=D.ProductId full outer join Product G with (nolock) on APP.IRManualProductId=G.ProductId full outer join Brand H with (nolock) on D.BrandId=H.BrandId full outer join Manufacturer I with (nolock) on H.ManufacturerId=I.ManufacturerId full outer join Brand J with (nolock) on G.BrandId=J.BrandId full outer join Manufacturer K with (nolock) on J.ManufacturerId=K.ManufacturerId full outer join ProductCategory L with (nolock) on D.ProductCategoryId=L.ProductCategoryId where G.UPC Like '99999%' and g.ClientId = '77' and Convert(char(10),AP.CreatedOn,126) >= '2025-04-01' group by AP.CreatedOn,AP.ClientId,C.ClientName,SceneTypeId,SceneTypeCategory,AP.SceneTypeCode,SceneTypeName,AP.SceneSubTypeCode,AP.SessionUid,AP.SceneUid,AP.SceneId,AP.StatusId,AP.SelfCheck,OrientationID,D.Type,D.SellingPackFrontFacings,D.SellingPackSideFacings,APP.productId,D.Product,D.SKU,RESkuCode,D.RESKUDescription,AP.ImageCount,IsIRQueued,AP.GroupId,BlockNumber,Shelf,Position,AP.ReportURL order by AP.CreatedOn asc,BlockNumber,Shelf --------------------------------------------------