[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

sum up some tablefields and build chart

Posted on 2000-02-16
4
Medium Priority
?
146 Views
Last Modified: 2010-04-04
hi, im a learner of delphi at the moment and wrote a small application. in this app. i have a table with numeric values. what im trying to do now is sum up a few of this values and automatically build a chart with these sums and then store the chart under a certain name. i tried several queries with sum but none worked. i hope u can help me find a solution, thx
0
Comment
Question by:ugross
[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
  • 2
4 Comments
 
LVL 12

Expert Comment

by:rwilson032697
ID: 2530100
You can sum a field in a table like this:

select sum(Afield) as FieldSum from ATable where ATable.AnotherField = 42

Cheers,

Raymond.
0
 

Author Comment

by:ugross
ID: 2530110
hi, sounds pretty simple and ok will try it, do u have any idea how to put these value straight into a chart. cheers

0
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 300 total points
ID: 2530124
You can so this using a TChart (in the additional tab).

Add one of these to a form, create an appropriate series and use code somethting like this to fill it in:

(This is a snip from my Mortgage Planning app where it creates a chart of interest and principal payments over time)

  for I := 0 to CurrentScenario.Payments.Count - 1 do
    begin
      TotalScenarioInterest := TotalScenarioInterest + CurrentScenario.payments[i].InterestPortion;

      ScenarioPrincipalSeries.AddXY(CurrentScenario.Payments[i].PaymentDate,
                                    CurrentScenario.Payments[i].PrincipalRemaining, '', clTeeColor);
      ScenarioInterestSeries.AddXY(CurrentScenario.Payments[i].PaymentDate,
                                   TotalScenarioInterest, '', clTeeColor);
    end;

Cheers,

Raymond.
0
 

Author Comment

by:ugross
ID: 2530135
thanks for this profund answers rymond, will try them, thou i think there must be something more simple. cheers and thx
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

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…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
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, …
Suggested Courses

656 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