field C is the result of the substraction between filed A and field B from the same table

5 pts.
Tags:
Microsoft Access
How to create a field C into a MS Access table which will be the result of the subtraction between filed B and filed A on the same table. Like: C=B-A

Answer Wiki

Thanks. We'll let you know when a new response is added.

I am going to be slightly rude here and say you don’t do this. Generally accepted database standards state that you do not store any values that can be calculated. This is because if you change any of the base values you have to recalculate the value and store it in the database again. Simply create a query with an expression like this: <b>C:[a]-[b]</b> and you will be fine. In SQL it looks like this:

<b>select a-b as C from table;</b>

If you must store it, it should only be in a table that the data doesn’t change, such as for a data warehouse or you are storing it for historical purposes. The update statement would simply be:

<b>update table set c = a -b;</b>

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: