Source language: Translate to:

Error message on Calculation

Questions about our Advanced Database plug-in

Moderator: Neosoft Support

Error message on Calculation

Postby BRobinsonS » Sun Jul 12, 2015 10:38 am

Scrolling with a Master/Detail set of table, I want to Add or Subtract two field in the Detail table to display the difference.
If the at least one of the field has a value then it calculates correct (except - *read below)
If there is no record for the detail table, the Calculation shows 'Error' for the Subtraction (or Addition).

*If an error occurs, the next master/detail that does have a valid number for one of the field in the detail table but does not clear the error.

This applies to Report Designer too.

How do I get Neobook / NeobookDBPro and Report Designer to indicate Zeros for the Calculation and not 'error' ?
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Error message on Calculation

Postby Neosoft Support » Sun Jul 12, 2015 11:41 am

You could try setting a default value of 0 (zero) for the fields to prevent the calculation from failing. The default value can be set when you define the fields in dbpCreateTable.

If that doesn't work, can you provide a small sample pub and db that demonstrates what you are doing?
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA

Re: Error message on Calculation

Postby BRobinsonS » Mon Jul 13, 2015 8:12 am

I have finally tracked down the problem.
Apparently 'MATH' does not allow you to subtract two currency values when the second number is greater than the first.
i.e. Math "[First]-[Second]" "2" "[Diff]" results in 'Error' when [Second] is greater.

So now I test to see if First is larger, then do Math above else Math "[Second]-[First]" "2" "[Diff]"
Then SetVar "[Diff]" "-[Diff]"
Brian Robinson
'When all else fails, try again!'
www.ComputerSoftwareSystems.com
User avatar
BRobinsonS
 
Posts: 340
Joined: Sun Sep 25, 2005 9:00 pm
Location: Ontario, Canada

Re: Error message on Calculation

Postby Neosoft Support » Mon Jul 13, 2015 9:31 am

If the numbers are formatted as currency, then you might also need to remove the currency symbols before performing the calculation.
NeoSoft Support
Neosoft Support
NeoSoft Team
 
Posts: 5605
Joined: Thu Mar 31, 2005 10:48 pm
Location: Oregon, USA


Return to NeoBookDBPro

Who is online

Users browsing this forum: No registered users and 1 guest

cron