Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

running total ?

Posted on 1998-08-30
4
Medium Priority
?
171 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
[X]
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
  • 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

618 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