You sure you want a script to do this calculation? Why not just a calculation field?
A calc field resulting in a number, defined as Get(CurrentDate) - Table:: PaymentDate should do the job, no?
The trick will be how to identify the LAST payment date. If this is not already in your bag of tricks, check out the Last( ) function and the Min( ) or Max( ) functions and see which is more appropriate to your design.
Things that come to mind as possibilities are:
Get(CurrentDate) - Last (Table:: PaymentDate)
Get(CurrentDate) - Max(Table:: PaymentDate) or
Min ( Get(CurrentDate) - Table:: PaymentDate )
that worked liked a charm
once again very much appreciated ninja