Forum Discussion
Return Value where ID<ID (Nested Query)
- Jan 15, 2025
Hi,
Try this:
SELECT IDParentfk, IDRollsPK, Rate,
DLookUp("Rate","tblFXRollsChild","IDRollsPK=" & Nz(DMax("IDRollsPK","tblFXRollsChild","IDParentfk=" & [IDParentfk] & " AND IDRollsPK<" & [IDRollsPK]),[IDRollsPK])) AS LastRate
FROM tblFXRollsChild
ORDER BY IDParentfk, IDRollsPK;Servus
Karl
****************
Access Forever News DevCon
Access-Entwickler-Konferenz AEK
Hi,
Try this:
SELECT IDParentfk, IDRollsPK, Rate,
DLookUp("Rate","tblFXRollsChild","IDRollsPK=" & Nz(DMax("IDRollsPK","tblFXRollsChild","IDParentfk=" & [IDParentfk] & " AND IDRollsPK<" & [IDRollsPK]),[IDRollsPK])) AS LastRate
FROM tblFXRollsChild
ORDER BY IDParentfk, IDRollsPK;
Servus
Karl
****************
Access Forever News DevCon
Access-Entwickler-Konferenz AEK
thanks Karl. that worked perfectly! I did try a Dlookup before posting this question but I wasnt using the Dmax. thanks again!