Created
July 11, 2018 20:38
-
-
Save phillijw/8b2683cefe01931107486735af393d21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
es.SubCategoryName | |
,es.ClientProductID | |
,es.ProductSID | |
,CAST(ps.DATE AS DATE) DATE | |
,Price | |
,Cost | |
FROM ProductStatus ps | |
JOIN v_EnterpriseStructure es ON es.ProductSID = ps.ProductSID | |
JOIN PriceZone pz ON pz.PriceZoneID = ps.PriceZoneID | |
WHERE es.ProductSID = '9577C393-833B-4ACB-9A8E-8B748C65A488' | |
AND CAST(ps.DATE AS DATE) = CAST('2014-12-17' AS date) | |
GROUP BY | |
es.SubCategoryName | |
,es.ClientProductID | |
,es.ProductSID | |
,ps.DATE | |
,ps.Price | |
,ps.Cost; | |
or | |
SELECT es.SubCategoryName, es.ClientProductID, es.ProductSID, CAST(ps.DATE AS DATE) DATE, Price, Cost | |
FROM ProductStatus ps | |
JOIN v_EnterpriseStructure es ON es.ProductSID = ps.ProductSID | |
JOIN PriceZone pz ON pz.PriceZoneID = ps.PriceZoneID | |
WHERE es.ProductSID = '9577C393-833B-4ACB-9A8E-8B748C65A488' | |
AND CAST(ps.DATE AS DATE) = CAST('2014-12-17' AS date) | |
GROUP BY es.SubCategoryName, es.ClientProductID, es.ProductSID, ps.DATE, ps.Price, ps.Cost; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment