Solved

calculation in access

Posted on 2009-07-03
5
432 Views
Last Modified: 2013-11-27
Hello

I have a column in access that contains a number. I would like to create another column that has the difference of that number from 30. For example if the first column contained the number 17 then the second column would contain the number 13.

thanks for your help
0
Comment
Question by:netplus21
  • 3
5 Comments
 
LVL 2

Expert Comment

by:bgrandjean
ID: 24773208
Use design view on the table to create the new column then use an update query to do the calculation and update the new field.
0
 
LVL 14

Expert Comment

by:shru_0409
ID: 24773214
pls explain with proper example
0
 
LVL 77

Expert Comment

by:peter57r
ID: 24773231
If this is always the rule then you should not be storing the second value at all.
You can always calculate it whenever you need it.
If you store it there is a fair chance that the two values will get out of synch and no longer add up to 30.

Also, to do this you would have include code in your data entry form to calculate the second value and drop it into a textbox bound to the second field.

You cannot do things like this in the table design.



0
 
LVL 2

Accepted Solution

by:
bgrandjean earned 250 total points
ID: 24773280
See attached sample query
sampleQuery.jpg
0
 
LVL 2

Expert Comment

by:bgrandjean
ID: 24773296
While the query I have shown will do what you ask I agree with Peter57r that what you are suggesting is not usually a good idea
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

820 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