Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I make a field add or multiply two different fields? 3

Status
Not open for further replies.

Tasuki

MIS
Jul 26, 2002
169
US
As the Subject field states... I'm trying to make a field add two other fields together and print the result in that field. How do I go about doing this, if at all possible?

T
 
In the design view of a query you can type things like this into a field:
NewFieldName: [ExistingField1] + [ExistingField2]

When you run your query you'll see the result. You can do all sorts of math and manipulations likle this in queries, forms, and reports.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
So it's better to create a field through the query, than to create a field within the table to add two different fields?

T
 
After you create your result field in your table, you could create an update query which would calculate the multiplication or addition of your two data fields and update the result field with the answer.
 
Tasuki,

MUCH better to create it only in the query and not store it in the table. One of the cardinal rules of creating databases is that you avoid storing calculated values in your database whenever possible.

There's a great article on my website, written by Paul Litwin, that explains this rule and the other essential rules to be used when creating databases. It's in the developer's section.

Jeremy =============
Jeremy Wallace
Designing, Developing, and Deploying Access Databases Since 1995

Take a look at the Developer's section of the site for some helpful fundamentals.


Remember to reward helpful tips with the stars they deserve.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top