# calculation fields

**URL:** <https://forum.servoy.com/t/calculation-fields/118>\
**Category:** Classic Servoy\
**Created:** [June 7, 2003, 6:58am UTC](https://forum.servoy.com/t/calculation-fields/118 "2003-06-07T06:58:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ron](https://forum.servoy.com/u/Ron)\
**Post date:** [June 7, 2003, 6:58am UTC](https://forum.servoy.com/t/calculation-fields/118/1 "2003-06-07T06:58:34Z")

</div>

I want to make a calculation-field.  
So I created two colums: INPUT and CALC  
Now I want to make a simple calculation like: CALC=INP\*2  
I want the result to be showed in the CALC field and to be stored in de DB.  
What is syntax?  
 ![:x]( "Mad")

---

<div class="post-metadata">

**Author:** ![maarten](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@maarten](https://forum.servoy.com/u/maarten)\
**Post date:** [June 7, 2003, 8:43am UTC](https://forum.servoy.com/t/calculation-fields/118/2 "2003-06-07T08:43:36Z")

</div>

Stored calc:

1. create column “calc” in your table  
2)create calculation with same name “calc”  
(Servoy matches the two, and stores calc result in database

Unstored calc:

1. only create calculation

notes:  
-you can turn an unstored calc into a stored one by creating a column with same name.  
-unstored and stored calcs always get refreshed when needed in GUI.

---

<div class="post-metadata">

**Author:** ![Ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ron](https://forum.servoy.com/u/Ron)\
**Post date:** [June 7, 2003, 11:08am UTC](https://forum.servoy.com/t/calculation-fields/118/3 "2003-06-07T11:08:34Z")

</div>

Sorry Maarten, it still does’nt work.  
This seems more complicated than in filemaker, but I don’t give up (yet).  
Now what I did step by step.

1. Created column INP (value: number)
2. Created column CALC (value: number)
3. Created calculation CALC (value: number)  
Indeed type STORED.  
Now putting the calculation itself: line1: Return 1; (default)  
line2: INP+2;

Testing: entering “5” in INP field: nothing happens in CALC field, it stays empty.  
What went wrong?

---

<div class="post-metadata">

**Author:** ![Ron](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@Ron](https://forum.servoy.com/u/Ron)\
**Post date:** [June 7, 2003, 12:27pm UTC](https://forum.servoy.com/t/calculation-fields/118/4 "2003-06-07T12:27:50Z")

</div>

PROBLEM SOLVED! ![:D]( "Very Happy")

What went wrong?

Code was not correct.  
shoud have been: line1: Return inp+2  
But also I did’nt notice there were no recs in my database!  
Also I had a look first in the CRM, for the code.
