Originally Posted by
Ajax
The access query wizard does tend to overdo the brackets, basically to compensate for potential inconsistencies - can't remember the term, think it is 'boolean logic' but you need some to ensure the calculation is done correctly
you can remove some brackets
HAVING (Sum(tblCCTransaction.Quantity)+(Sum(tblCCTransaction.CallQuantity)*100)>0)
but remove more and your calculation might be misinterpreted
this part
(Sum(tblCCTransaction.CallQuantity)*100)>0
might be interpreted as true so adding -1 to Sum(tblCCTransaction.Quantity)
you also don't need to use the table name if the field name is unique within the fields available (e.g. your equityID field is used in both tables so is not unique - I use PK and FK rather than ID for this reason plus they also identify which end of the relationship I am dealing with) so you could just have
HAVING (Sum(Quantity)+(Sum(CallQuantity)*100)>0)
but go back to the query designer and save and access will put it all back