Hi, I have 2 tables: Sales> Code, Price, sDate History>Code, Cost, hDate
The sales record sales for each product by its code. The History table has the cost history of each product at different date. I need to know the last cost of each product in the sales table at the date of the sales. Can anyone help me with the query? It should be something like : select a.code,a.price,b.cost,a.sDate from sales a, history b where a.code=b.code and b.hdate<a.sdate Thanks. Vel