Calculated Fields

D

Darshan.

I am trying to make a Simple Stock database for personal Use

Regular Fields:-

Name:- Type:-
Security Text
Open Number
High Number
Low Number
Close Number


Calculated Fields :-

Name:- Type:- Formulae:-
P Number ( [High] + [Low] +
[Close] ) / 3
R1 Number 2 * [P] - [Low]
R2 Number [P] + ( [High] -
[Low] )
S1 Number 2 * [P] - [High]
S2 Number [P] - ( [High] -
[Low] )



How Do i achieve this ??
is it possible within same table ???

I tried to put the formulas as Default values for calculated Fields
but it gives an error 'The database engine either does not recognise Field
'High' in a validation expression or the default value in table 'Table1'

seems like a piece of cake for u pro`s.

Any help wd be appreciated

- Darshan
 
J

John Vinson

How Do i achieve this ??
is it possible within same table ???

I tried to put the formulas as Default values for calculated Fields
but it gives an error 'The database engine either does not recognise Field
'High' in a validation expression or the default value in table 'Table1'

A database IS NOT A SPREADSHEET.

Storing derived data such as this in your table accomplishes
three things: it wastes disk space; it wastes time (almost
any calculation will be MUCH faster than a disk fetch); and
most importantly, it risks data corruption. If one of the
underlying fields is subsequently edited, you will have data
in your table WHICH IS WRONG, and no automatic way to detect
that fact.

Just redo the calculation whenever you need it, either as a
calculated field in a Query or just as you're now doing it -
in the control source of a Form or a Report textbox.


John W. Vinson[MVP]
 
Top