Last active
December 14, 2015 11:59
-
-
Save rpastorelle/5083561 to your computer and use it in GitHub Desktop.
Query Product Reviews for previous 7 day period.
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 p.ProductCode, p.ProductName, | |
r.ReviewTitle, r.Rate, r.ReviewDescription, | |
r.LastModified | |
FROM Products p | |
INNER JOIN Reviews r ON r.ProductCode = p.ProductCode | |
WHERE r.LastModified | |
BETWEEN CONVERT( VARCHAR(10) DATEADD(day, -7, GETDATE()), 101 ) + ' 0:00' | |
AND CONVERT( VARCHAR(10) DATEADD(day, -1, GETDATE()), 101 ) + ' 23:59' | |
ORDER BY r.LastModified DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment