Ok, still don't know why the access crashes since your scalar query is just fine from syntax point of view. Could it be that it doesn't like the
Temp
-alias, doesn't understand the correlation etc.
However, having a closer look at your query, could you use just a simple group by-query. SOmething like:
SELECT a.Article,
a.Date,
a.Price,
count(*)
FROM tblPriceHistory a left join tblPriceHistory b
on (a.Article=b.Article and b.Date <= a.Date)
group by a.Article,
a.Date,
a.Price