Forum Discussion
Tony2021
Oct 04, 2022Steel Contributor
Aggregate Qry - Use LAST of Non Zero Number
Experts, I have an aggregate query as below (and attached file) that returns the LAST record on RATE. I need to somehow adjust it to use the LAST of RATE of the non zero number. You can see t...
- Oct 06, 2022
Hi,
How about this?
SELECT T1.IDParentfk, T1.Rate
FROM tblFXRollsChild AS T1
WHERE T1.IDRollsPK=(SELECT Max(IDRollsPK) FROM tblFXRollsChild WHERE Rate<>0 AND IDParentfk=T1.IDParentfk)
ORDER BY T1.IDParentfkServus
Karl
************
Access News
Access DevCon
Oct 06, 2022
Hi,
How about this?
SELECT T1.IDParentfk, T1.Rate
FROM tblFXRollsChild AS T1
WHERE T1.IDRollsPK=(SELECT Max(IDRollsPK) FROM tblFXRollsChild WHERE Rate<>0 AND IDParentfk=T1.IDParentfk)
ORDER BY T1.IDParentfk
Servus
Karl
************
Access News
Access DevCon
- Tony2021Oct 06, 2022Steel ContributorWorked perfectly! thank you Karl. Nested query. Scary.