Forum Discussion

Tony2021's avatar
Tony2021
Steel Contributor
Oct 04, 2022

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...
  • Karl_Donaubauer's avatar
    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

Resources