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

x
?
Solved

Adding Field

Posted on 2004-10-01
3
Medium Priority
?
160 Views
Last Modified: 2010-04-05
Hi EveryOne!

 Table:  MONEY.DBF
 Fields:  DESC  ftString   10
            DR      float         0
            CR      float         0
 

  When i want to display the values in the GRID it should be like this one..

  Desc      DR      CR            BALANCE
  0NE       100                     100
  TWO              -20             80
  THREE            -10             70
  FOUR     20                       90
  FIVE               -40             50
  SIX                 -50              0

 Now my question is how will i include the "BALANCE" field on the grid which is that this field "BALANCE" is not included in the TABLE money.dbf? How will i make the formula for this and assigning it to "Balance"

thanks alot!


0
Comment
Question by:girlswants_me
[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
3 Comments
 
LVL 22

Accepted Solution

by:
Mohammed Nasman earned 500 total points
ID: 12198152
Hello

   Create Calculated Field, here's how u can do it,

1. Drop Table component than double click on if, when the Field editor open right click and add the fields you would like to use.

2. Right click on the Field editor again and choose New field, New field window will appear to you, define field with name and data type, choose it's type as Calculated

3. From Table's events choose OnCalcField, and write the formula that will calculate your new field, as following:

procedure TForm1.Table1CalcFields(DataSet: TDataSet);
begin
  Table1['MyNewField'] := Table1.fieldByName('MyField').AsInteger * 1.1;
end;

Now you would see the MyNewField add to your DBGrid, and the values will calcuated on the run time, without adding new field to your table

HTH

Regards,
Mohammed
0
 

Author Comment

by:girlswants_me
ID: 12199030
hI,

How will i make the formula for this and assigning it to "Balance"? kINDLY observe the values under the "balance" field... do you know on how to compute those values?
0
 

Author Comment

by:girlswants_me
ID: 12224109
Hi,

I got it, thanks a lot.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
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