Calculated fields

This forum is for application developers who are integrating HanDBase into their solutions via the HanDBase API (HAPI) or other means. It's also a great place to discuss runtime development.

Calculated fields

Postby sababe » Mon May 27, 2013 4:18 pm

Dear experts, please help!

I would like to have following behaviour between two fields in one database table:
One field "Counter" (integer) stores amount of articles
The other field "Date Consumed" (date) stores the date of the last article consumed, when the Counter becomes zero.

Currently both fields have to be entered manually. I would love to set one of the fields as a "calculated field" automaticaly, when the other field is entered. E. g. the Counter =0 when the Date Consumed ( mostly "today") is entered or vice versa, the Date Consumed = "today" when Counter is set to =0 which ever is easier to implement, if possible at all.

Can somebody please give me a hint whether this is possible and if yes how?
Many thanks

Posts: 3
Joined: Thu May 23, 2013 6:40 pm

Re: Calculated fields

Postby Brian_Houghton » Tue May 28, 2013 12:45 am

Hello Sandra,

Thanks for posting.

First, in regards to the calculated field that increments/counts, you should set the formula to:

Previous Value of (this) Field + Current Value of (this) Field

Then set the value to be returned as an integer.

Regarding the date value, could you set the parameter of a date field to record the last time that the record was modified?

Sent from my Nexus 7 using Tapatalk 2
Kind Regards,
Brian Houghton, DDH Software
Posts: 2248
Joined: Wed May 20, 2009 8:30 am

Return to HanDBase - Developers

Who is online

Users browsing this forum: No registered users and 0 guests