This expression returns a total of Rev-Amount from my Revenue subtable until the "where" portion is inserted. Any idea why?

sum(Revenue.'Rev-Amount'where Revenue.'Credit To:'=1)


I'm not a expert by I think:

Revenue.'Rev-Amount' returns a list of all values in the Rev-Amount field of the Revenue Table.

The builtin sum(...) function returns the sum of whatever list you have in parenthesis.

Then the total you get.

Masters please correct me if I'm wrong.



Ninox Profile

Try this...


sum((select Revenue where Revenue.'Credit To' = 1).'Rev-Amount')


I wasn't sure if the colon was a part of the 'Credit To' field name so I didn't include it.


No luck. It returns an error on the where statement. I took out the second revenue table identifier and it sums all accounts in the database rather than just the individual one. Thanks for trying

Ninox Profile

If I may Sean...

And this?
sum((select Revenue where 'Credit To:' = 1).'Rev-Amount')

'credit to' has to be a number field or a choice field. If it is a text field you have to use number('Credit To:') in the syntax.


Ninox Profile

Steven, of course :)


Yes the Credit To: is a choice field with four options starting with 1


Works perfectly- thanks!!!