Hello sahems.y.3
The calculated field you have set in you database via MVD is not an actual field.
It appears when you want to setup a TableGrid in the list of available fields, but if you open the database file, you will notice that there is no actual storing of the calculated value.
Look at this simple table with calculated field :
The third field (called amount) is just the multiplication of unit price by quantity.
If you look at the result in the Tablegrid here is what you get :
The calculation is done correctly BUT... if you look at the database file, here is what you'll find :
There is no trace of the calculated field. This is because the calculated value is not stored in the database, it is calculated each time you display the result in the Tablegrid.
You have 2 choices :
1- you setup a field in the database, which is not calculated but in which you store the value you have calculated yourself (I do not advise that because if you change the stored values for price and quantity, the calculation is not automatically updated)
2- you include the calculation in your query
This is valid for my example with prices and quantities, and this is also valid for your example with dates.
In your case, I guess that the part in red in 'SET Duedate = DATE(Caldate,'+365 Day')' is querying a value that is not stored but calculated, so this red part should be a sub-query in your query recalculating the value.
Unfortunately, I do not have enough material to help you further without code and database.
Hope this helps a little
Cheers
Mathias
I'm a very good housekeeper !
Each time I get a divorce, I keep the house
Zaza Gabor