Multiple selects, group by's variables etc in ACE
Posted in 1995
I have a few questions. 1: What is the point of being able to do a number of selects in writing an ACE report if only the last one has any effect? 2. Can you set a variable to the returned value of a select in ACE. 3. I have a table id item val1 val2 total with the following sort of rows 1 2 4.1 6.2 6 1 2 5.1 7.2 6 1 2 9.1 6.2 6 1 3 7.1 6.1 2 1 3 0.2 5.1 2 2 1 8.1 9.0 3 The final column value are totals of some qty of all value of the rows with the same primary key (which is columns 1 and 2 combined. So that the 6 applies to all three rows that have 1, 2 as the primary key. And I want to total all values for each primary key and each group of rows having the same value in column 1. However, I don't want to count the "6", for example, more than once. If I use group by, I get 22 for the sum of all of group by id. I WANT to get 8! Even if I don't have a "group by item". I realise I can get round this by setting up variables and resetting them on change of groups, but it's messy. I tried setting a variable in the outer "group by" clause and summing the contents by group total of variable, but that didn't work.