Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

calculation in access

Posted on 2009-07-03
5
Medium Priority
?
444 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 1000 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

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

Recursive SQL is one of the most fascinating and powerful and yet dangerous feature offered in many modern databases today using a Common Table Expression (CTE) first introduced in the ANSI SQL 99 standard. The first implementations of CTE began ap…
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

772 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