AnsweredAssumed Answered

Finding the difference of the field between current record and previous one

Question asked by JohnAbenaim on Mar 25, 2014
Latest reply on Apr 11, 2014 by philmodjunk

Title

Finding the difference of the field between current record and previous one

Post

     My project is as follow: 

     I want to find out the difference between the current record and previous one to calculate the net balance so that i can charge the correct amount to clients. 

     My database has 2 tables: Client & Transaction

     1. Client

         
  1.           Client ID (Auto Entered Serial)
  2.      
  3.           Client Name (Text)

     2. Transaction

         
  1.           Date (date field)
  2.      
  3.           Client ID (Number)
  4.      
  5.           Current Balance prints (Number)  (amount printed since client was added on the printer)
  6.      
  7.           Lookup prints (calculation)  = Let ( N = Get ( RecordNumber ) ; If ( N > 1 ; Balance of BW - GetNthRecord (Balance of BW ; N - 1 )  ; "" ) )
  8.      
  9.           Net Prints (calculation) = Balance of BW - Lookup Total BW
  10.      
  11.           Prints Charge (calculation) = (Net Prints * .10)

     I setup 1 relationship being Client ID between the two tables. 

     The problem is that for the the 2nd record i get nothing for lookup field. 

     Any thought? 

Outcomes