Solved

calculation in access

Posted on 2009-07-03
5
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article describes a method of delivering Word templates for use in merging Access data to Word documents, that requires no computer knowledge on the part of the recipient -- the templates are saved in table fields, and are extracted and install…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

615 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