Solved

calculation in access

Posted on 2009-07-03
5
430 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Email Header Detail 12 55
IIF help, YN field 7 22
Filter a form 8 15
Access Importing Table Query With Specific Timestamp Daily 2 14
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
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…

809 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