7 Replies Latest reply: May 7, 2014 1:17 AM by anbu cheliyan RSS

    Grabbing the latest value from a field



      I'm having a problem with grabbing the latest value from Field 2 & Field 3 WHERE Field 1 is DISTINCT. I'm trying to do a count on the total number of active users and for this to be accurate I'll need to get all the distinct users through the unique identifier and get their latest status where it is equal to active.


      This is an example of the table I have:


      Example of Current Table

      8181828 16:00:23Work PermitActive
      8181828 16:00:23Work PermitInactive
      9959599 06:56:23PassportSuspended
      9959599 06:56:23LocalActive


      Count of Active Users : 2. (Inaccurate)


      Expected Result


      8181828 16:00:23Work PermitInactive
      9959599 06:56:23LocalActive


      Count of Active Users : 1. (Accurate)


      Thanks in Advance,