Hi I am trying to find the MAX(Date) in a table and then calculate the results from that row and then find the date that is equal or less than that date and calculate the results of that field. For example:
Ref Date Qty
6 29/09/01 2
6 02/08/01 3
6 01/07/02 1
23 28/09/01...
I have tried this query, but I am returning 24 rows and not 6 rows. Can you suggest a improvement, please.
SELECT t.NodeType
, t.Reference
, t.GID
, t.Date
, t.Quantity
, m.Price1
, t.Quantity*m.Price1
FROM ( SELECT NodeType
, Reference...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.