?
Solved

running total ?

Posted on 1998-08-30
4
Medium Priority
?
173 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 400 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses

850 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