Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

running total ?

Posted on 1998-08-30
4
163 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Delphi : could not find program, '...exe' 2 191
Print Graphic and Text to Epson TM-T88v 12 380
Wincontrol not (correctly) drawn 15 40
Microsoft Access 97 and Delphi XE2 9 54
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…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

860 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