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

Calculated Fields - How to

Posted on 1998-10-27
2
186 Views
Last Modified: 2010-04-06
Simple question. How do I define and access a calculated field in a table.

I have two field values i want to multiply, with the total going in the calculated field.

Thanks.
0
Comment
Question by:DougBennett
2 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1344649
0
 
LVL 2

Accepted Solution

by:
Thaddy earned 10 total points
ID: 1344650
Go to the fields editor.(Doubleclick on the table, then rightclick)
Add the two fields you want to multiply
Then, create a new field, set its type to calculated.
and its fieldtype to float. We'll call it 'Calc'
Then, on the OnCalcFields event of the table, use something like:
with table1 do
 FieldByname('Calc').AsFloat:=FieldByName('Field1').AsFloat*FieldByName(Field2').AsFloat;

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 96
Making delphi communicate with a c# service 16 111
Firemonkey allowing RTL on android 6 47
Delphi problems to abort a printjob 9 24
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

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