Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

total money have in a grid column

Posted on 1999-06-30
5
Medium Priority
?
139 Views
Last Modified: 2010-04-06
How can i calculate or get the total of a currency value in a grid COLUMN.  
(database paradox)
ex.
     price

     100.00
     300.00
     150.00
     ======
     550.00
0
Comment
Question by:mvalez
[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
  • 4
5 Comments
 
LVL 12

Accepted Solution

by:
rwilson032697 earned 40 total points
ID: 1385600
Try this in a TQuery:

Select Total as Sum(Price) from TheTable

Then you will have one row in the result set with one field with the value you want!

OR you can run through all the rows yourself and add them up like this

Total := 0
while not Query.EOF do
  begin
    Total := Total := Query.FieldsByName['Price'].AsFloat;
    Query.Next;
  end;

Cheers,

Raymond.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1385601
Err.. THe second := should be a +     :-(
0
 

Author Comment

by:mvalez
ID: 1385602
Thank you very much...
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1385603
Glad to help!

Cheers,

Raymond.
0
 
LVL 12

Expert Comment

by:rwilson032697
ID: 1385604
Hmm...

I think this:

Select Total as Sum(Price) from TheTable

should read:

Select Sum(Price) as Total from TheTable

Cheers,

Raymond.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

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…
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…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

721 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