Solved

running total ?

Posted on 1998-08-30
4
160 Views
Last Modified: 2010-04-04
well, i want to make a invoice form using master detail relation but i got problem to show total ammount of detail item. Help me please.
0
Comment
Question by:delphyst
  • 2
4 Comments
 

Author Comment

by:delphyst
ID: 1338141
i'm using
-TTable both for master and detail

0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1338142
delphyst,

use a query for it or make your detail also a master of another detail (=> this one calculates total of detail).

Zif.
0
 
LVL 8

Accepted Solution

by:
ZifNab earned 200 total points
ID: 1338143
Use SQL,

something like this :

SELECT SUM(O.ItemsTotal), SUM(O.AmountPaid)
FROM ORDERS O

Regards, Zif.

0
 
LVL 3

Expert Comment

by:vladika
ID: 1338144
See example in Delphi 3\Demos\DB\CtrlGrid\CtrlGrid.dpr
procedure TDM1.CalculateTotals(Sender: TObject; Field: TField);

In short
    Detail.disableControls;  { hide this process from the user }
    Detail.first;
    while not Detail.eof do
    begin
      // calculate Totals
      Detail.next;
    end;
    Detail.first;
    Detail.enableControls;  { restore the display }

If you want only total ammount of detail item
use Detail.RecordCount

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now