Morning,
This is similar to a question i asked yesterday [question]: SQL query to get latest prices, depending on the date
I need to return a list of ASIN’s which are have not been updated within 24 hours from the last update date from the lowest price table. I can get a list of ASIN’s, however it returns all of them. Could someone pleas help me with the SQL to get this list please?
SELECT asin
FROM dbo.aboProducts
WHERE (asin NOT IN
(SELECT aboProducts_1.asin
FROM dbo.aboProducts AS aboProducts_1 INNER JOIN
dbo.LowestPrices ON aboProducts_1.asin = dbo.LowestPrices.productAsin
WHERE (dbo.aboProducts.amzLive = 'true') AND
(dbo.LowestPrices.priceDate < DATEADD(day, - 1, GETDATE()))))
I think you’ve got your comparison the wrong way round
Try