0

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)

7 replies

null
    • JGM
    • Jose_Monteiro
    • 4 yrs ago
    • Reported - view

    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.

    • Sean
    • 4 yrs ago
    • Reported - view

    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.

    • Wisconsin Masonic foundation
    • Gary
    • 4 yrs ago
    • Reported - view

    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 partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    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.

    Steven

    • Sean
    • 4 yrs ago
    • Reported - view

    Steven, of course :)

    • Wisconsin Masonic foundation
    • Gary
    • 4 yrs ago
    • Reported - view

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

    • Wisconsin Masonic foundation
    • Gary
    • 4 yrs ago
    • Reported - view

    Works perfectly- thanks!!!

Content aside

  • 4 yrs agoLast active
  • 7Replies
  • 1091Views