Hi
Thanks in advance for helping.
I'm using the following query to grab the most recent price from TR-Prices, this query (Generate-Latest-Prices) is still working
TR Prices contains three columns, SKU DATE PRICE
I have another query which then pulls the latest price from Generate-Latest-Prices which has been working perfectly.
However, since adding more prices/dates, I'm now getting this error on the second query, which is querying Generate-Latest-Prices to get the latest price:
"At most one record can be returned using this subquery"
Aside from adding more data into the DB, I can't think of anything else which has changed to cause this error.
Any query trying to pull the latest price from generate-latest-prices is getting this error, none where before the new prices where added
Any help will be greatly appreciated, as I'm currently pulling my hair out trying to figure this out!
Kind regards
Thanks in advance for helping.
I'm using the following query to grab the most recent price from TR-Prices, this query (Generate-Latest-Prices) is still working
TR Prices contains three columns, SKU DATE PRICE
Code:
(SELECT TOP 1 Price FROM [TR-Prices] AS T1 WHERE T1.SKU = [TR-Prices].SKU AND T1.Date=(SELECT MAX(Date) from [TR-Prices] AS T2 WHERE T2.SKU = T1.SKU) ORDER BY T1.Price DESC)
However, since adding more prices/dates, I'm now getting this error on the second query, which is querying Generate-Latest-Prices to get the latest price:
"At most one record can be returned using this subquery"
Aside from adding more data into the DB, I can't think of anything else which has changed to cause this error.
Any query trying to pull the latest price from generate-latest-prices is getting this error, none where before the new prices where added
Any help will be greatly appreciated, as I'm currently pulling my hair out trying to figure this out!
Kind regards