how can i make a report to have the depit and the credit shown and the total which substitute the depit from the credit.
The data implementation depends on how you record the amount (signed/unsigned). You may either need two summary fields – one that summarizes debits, and one for credits – or create one calc field that holds a signed amount, depending on the type of debit or credit. Probably the former, because that let's you show what is what.
As to the display: create a list layout that has a sub-summary part for transactionType. Write a script that 1. searches for the desired date range and 2. (very important!) sorts by transactionType (because this is your summary part's break field).
Your daily balance by transactionType would be another calc field (say, cBalanceByType)
GetSummary ( sCredit ; transactionType ) - GetSummary ( sDebit ; transactionType )
which you would place in the sub-summary part.
To get the total balance of the found set, create either another calc field
GetSummary ( sCredit ; sCredit ) - GetSummary ( sDebit ; sDebit )
or a summary field that sums cBalanceByType.
Either way, that field goes into the header, or a grand summary part.
The nice thing about such a report layout is that it will work for any found set, meaning you could search for a single day, or a date range, and you could constrain the found set to a specific transaction type, or use all.
Read up on how reports and summary parts and fields work.
can you please give it a check and tell me why it is not working
• your script is referring to fields from a table (or table occurrence) that has been deleted, and thus cannot work
• the script is performing three identical looking Find operations (which by itself doesn't do any harm, but it's overly complex, hard to maintain and most likely unnecessary)
• the debit field is set to auto-enter the amount from the debit field (or vice versa…?), which doesn't make sense because then there isn't a balance!
• it seems you didn't include the field in the sort order that you used with GetSummary() – hard to tell because of the broken references
Again: define clearly what is the debit and what is the credit amount, then follow the guidelines I outlined in my first post to summarize those values per group; and, as also suggested, please read up on the workings of reports and summaries.
(And if you post a file for inspection, you should make sure it is at least formally correct …)