0 Replies Latest reply: Sep 11, 2012 6:46 AM by James Edgson RSS

    Return Future value.

      Hi,

       

      I have a TargetHit table that has the fields:

      UserID

      Year

      Month

      TargetHit

       

      What I need to do is, for each instance of userID, Year, Month where target hit is 0 (target not hit). Look for the next earliest Year and month for that user where the target was hit and return the month and year to show something like.

       

      UserID

      Year

      Month

      TargetHit

      FutureTargetHit

      FutureYear

      FutureMonth

       

       

      Does anyone know of a way to do this without having to do a for each loop and loop through each instance of UserID, Year and Month.

       

      Thanks in advance

      Jay