sum( where) help needed
I have a table named "Tax" which has a single user entered field named "Year" and then a number of formula fields that are supposed to collect data from other tables (Invoices, Expenses etc) in the database and carry out the appropriate calculations.
For example, the first ƒx field in "Tax" is "Income"
when I have the formula:
1. let xYear := year; // I know I don't need this yet//
2. sum((select Invoices).'Grand Total')
This works perfectly to give the total of all the invoices in the database.
The problem comes when I try filtering the the results by year.
I have tried this:
1. let xYear := year;
2. sum((select Invoices).'Grand Total' where year('Invoice Date') := xYear).'Grand Total');
I copied the structure from the ninox manual but I get an error message "Symbol expected: , at line 2, column 41"
I'm sure it's just a syntax error but I can't work it out.
Thanks in advance for the help.
4 replies
-
Michael Chung
let xYear := year; sum((select Invoices where year('Invoice Date') = xYear).'Grand Total')
I suppose year is a numberfield? If not then you might want to use todays year? Then use - let xYear := year(today()); -instead.
Steven
-
Worked it out. I was using := instead of =
Content aside
- 2 yrs agoLast active
- 4Replies
- 215Views
-
2
Following