Scott Marcus
marcus at tsstech.com
Wed Jul 28 12:46:53 CDT 2004
Mark,
Is this any closer(I'm just taking stabs now)? Save both queries and run the second one.
qry1:
SELECT tblPRS_Pending_PHONE.bo_id,
Max(tblPRS_Pending_PHONE.effdt) AS MaxOfeffdt
FROM tblPRS_Pending_PHONE
WHERE tblPRS_Pending_PHONE.Primary=True
GROUP BY tblPRS_Pending_PHONE.bo_id;
qry2:
SELECT tblPRS_Pending_PHONE.bo_id,
Last(tblPRS_Pending_PHONE.Phone) AS Phone_Number
FROM tblTest INNER JOIN Query4 ON (tblPRS_Pending_PHONE.effdt = qry1.MaxOfeffdt)
AND (tblPRS_Pending_PHONE.bo_id = qry1.bo_id)
WHERE tblPRS_Pending_PHONE.Primary=True
GROUP BY tblPRS_Pending_PHONE.bo_id;
Until I have a copy of the data, I cannot be sure this is 100% correct.
Scott