Solved

Calculated Fields - How to

Posted on 1998-10-27
2
185 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

ScreenConnect 6.0 Free Trial

Want empowering updates? You're in the right place! Discover new features in ScreenConnect 6.0, based on partner feedback, to keep you business operating smoothly and optimally (the way it should be). Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

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 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…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

831 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