Hung Nguyen 0 Posted December 22, 2016 Attention: Before posting in the general discussion forum please review the other forums that would best suit your topic. If you cannot find one then you may delete this text and post your topic in this forum. Hi everyone, I have a table DEADSTOCK like that: ------------------------------------------ Product | Open | Close MER | $10,757 | $764 OBU | $6,590 | $78 PAT | $2,471 | $0 RAP | $9,253 | $261 RIT | $1,252 | $0 ----------------------------------------- In monthly sales report (associated table: ORDERS), I need query table DEADSTOCK to extract a summary data, I used 3 variables have 5 repetitions as following: 1. $stock_depts Let( [ $query = "SELECT Product FROM DEADSTOCK ORDER BY Product ASC" ; $result = ExecuteSQL($query; ""; ¶) ; $stock_depts[1] = GetValue ( $result; 1 ) ; $stock_depts[2] = GetValue ( $result; 2 ) ; $stock_depts[3] = GetValue ( $result; 3 ) ; $stock_depts[4] = GetValue ( $result; 4 ) ; $stock_depts[5] = GetValue ( $result; 5 ) ]; "" ) 2. $stock_open Let( [ $query = "SELECT Open FROM DEADSTOCK ORDER BY Product ASC" ; $result = ExecuteSQL($query; ""; ¶) ; $stock_open[1] = GetValue ( $result; 1 ) ; $stock_open[2] = GetValue ( $result; 2 ) ; $stock_open[3] = GetValue ( $result; 3 ) ; $stock_open[4] = GetValue ( $result; 4 ) ; $stock_open[5] = GetValue ( $result; 5 ) ]; "" ) 3. $stock_close Let( [ $query = "SELECT Close FROM DEADSTOCK ORDER BY Product ASC" ; $result = ExecuteSQL($query; ""; ¶) ; $stock_close[1] = GetValue ( $result; 1 ) ; $stock_close[2] = GetValue ( $result; 2 ) ; $stock_close[3] = GetValue ( $result; 3 ) ; $stock_close[4] = GetValue ( $result; 4 ) ; $stock_close[5] = GetValue ( $result; 5 ) ]; "" ) In FileMaker 14, it works well and I got everything I need! But after upgrading to FM 15, variable $stock_depts just returns 4 values: MER, OBU, PAT, RAP insteads of 5 values: MER, OBU, PAT, RAP, RIT but if I try to read value of local variable $result, it's still true: MER¶OBU¶PAT¶RAP¶RIT. And the others $stock_open & $stock_close are wrong similarly! So what's the matter with my function? Please help me this case! Thanks for reading my thread! Quote Share this post Link to post Share on other sites
Wim Decorte 458 Posted December 22, 2016 Works like a charm in 15... I think something off in your data? I just copied and pasted your calc after creating the data. Quote Share this post Link to post Share on other sites