Finding the difference of the field between current record and previous one
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
Client ID (Auto Entered Serial)
Client Name (Text)
Date (date field)
Client ID (Number)
Current Balance prints (Number) (amount printed since client was added on the printer)
Lookup prints (calculation) = Let ( N = Get ( RecordNumber ) ; If ( N > 1 ; Balance of BW - GetNthRecord (Balance of BW ; N - 1 ) ; "" ) )
Net Prints (calculation) = Balance of BW - Lookup Total BW
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.