Related Information Examples & Tutorials

Dividing Two Money Fields

This topic explains how to divide two money fields. For example, you may want to divide a Promise Amount into the Debtor's Owing to arrive at a number of payments.

Collect! ships with many reports in the Demonstration database. The Promise Payment Acknowledgment report was used with a few quick modifications to create the snippet below. This will show you how to work with math in Collect! Using the Promise Payment Acknowledgment, please make these changes to the report and test it.

//code snippet
@!BALANCE ..................: @de.ow< @!

@varMons# = 0
@varRem$ = 0.00
@de.con no total where (@co.ty = Promise) where (@co.do = no) max = 1
@varMons = 0
@varMons = @(de.ow/co.am)
@varRem = @(de.ow-(co.am*varMons))
Payment Amt ...: @co.am< for @varMons< payments
and a final of @varRem< for the @(varMons+1)< payment
1st Due Date ....: @co.dd<

Dear @de.co< :
//end of snippet

As you can see, we are working with variables. This example goes on to explain any remaining money left after dividing the contact Promise Amount with the Debtor Owing.

Please refer to How To Perform Calculations On Data for further information and examples.

See Also

- Report Sample to view sample reports and letters
- Report Topics Index for a list of all report and letter topics

Top of page.

Was this page helpful? Do you have any comments on this document? Can we make it better? If so how may we improve this page.

Please click this link to send us your comments: helpinfo@collect.org