I maintain an internal website that serves as an accounting back end to a firm. A content type is created that records general journal entries that has debit and credit fields, among others.
From time to time, the firm's accountant want to check how much cash they have received and paid and further grouped in various classes only accountants know what. These values will then be called to create another content type that produce monthly reports. In the near future, there are plans to call the values elsewhere.
The quick way is use this module and make a SQL query to sum the required fields, as follows:
$node_field['value'] = db_result(db_query("
The display format is left to its default as follows:
$display = $node_field_item['value'];
Drop the PHP script opening and closing tags in the actual computed code text area.
Create the node, name a title and publish it. If any of the values are changed, this node needs to be republished. This can be done using the Rules module ro whatever necessary. The function can also be called by the name provided just below the code field.