By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,400 Members | 953 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,400 IT Pros & Developers. It's quick & easy.

Automated Calculation In a Table

P: 10
Hello,

I needed help in finding how can I get access to to automatically populate a column where the value is just simple arithmetics between two other columns.
For example:

DIFF = Col4 - Col5 where Diff is Col6.

I tried setting default value as " =[stop] - [start] " which are labels for my columns but access gives me an error saying that Database engine does not recognize the field stop.

I am using acess 2000 and running it on Windows 2000 professional.

Thank You
Dec 13 '07 #1
Share this Question
Share on Google+
6 Replies


Rabbit
Expert Mod 10K+
P: 12,396
The norm is not to store calculations but to calculate them when needed.
Dec 13 '07 #2

P: 10
But if you need to do that, what would be the way? It just that I get lots of data, and sometimes data that I want to use is simply the difference between two columns of data, or because its genetics data, there is a lot of repetition, so I can easily distinquish groups by the variable that calculates the difference.

Any suggestions?
Dec 13 '07 #3

Rabbit
Expert Mod 10K+
P: 12,396
You just create a query that has a calculated column that finds the difference. The problem with storing calculations in a table is that you're not guaranteed to have accurate data. And shall we agree that accurate data is more important than the little bit of extra time it would take to calculate it when you need it?
Dec 13 '07 #4

Nathan H
100+
P: 104
You just create a query that has a calculated column that finds the difference. The problem with storing calculations in a table is that you're not guaranteed to have accurate data. And shall we agree that accurate data is more important than the little bit of extra time it would take to calculate it when you need it?

If you run an update query on Col6 everytime before you open the table, you will have both...current data and stored in a table.

CInt([Table1]![Col4])-CInt([Table1]![Col5])
Dec 13 '07 #5

missinglinq
Expert 2.5K+
P: 3,532
The point is, in most situations you don't want to store calculated values, and you should never allow end users access to your tables! Following up Rabbit's suggestion:

Create a query based on the table.

In an empty Field box enter Diff: [Col4] - [Col5]

Base your forms/reports on the query.

Refer to Diff like you would any other field.

Welcome to TheScripts!

Linq ;0)>
Dec 13 '07 #6

P: 10
The point is, in most situations you don't want to store calculated values, and you should never allow end users access to your tables! Following up Rabbit's suggestion:

Create a query based on the table.

In an empty Field box enter Diff: [Col4] - [Col5]

Base your forms/reports on the query.

Refer to Diff like you would any other field.

Welcome to TheScripts!

Linq ;0)>

Thank You for your help!
Mar 17 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.