running32
asked on
Expression times out when running query
I am trying to get the maximum date for each record. There are numerous records for each NDC and I need to get the NDC record which has the maximum time stamp for each different NDC how can I do this without the expression timeing out.
thanks
thanks
SELECT r.NPT_PRICEx, r.NDC, r.NPT_DATEC
FROM RNP2 r INNER JOIN
(SELECT MAX(npt_datec) AS maxbbdc, NDC
FROM rnp2
GROUP BY NDC) a ON r.NDC = a.NDC AND r.NPT_DATEC = a.maxbbdc
WHERE (r.NPT_TYPE = '01')
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
wrong use of words... should have been "and" and not "that covers"
ASKER
thank you