[AccessD] Math Problem

Gustav Brock gustav at cactus.dk
Tue Oct 14 12:49:12 CDT 2003


Hi Lonnie

If you only have a few rows as shown I don't think you have any other
possibility than trying the different combinations using some loops.

You could, of course, start by ruling out some of the impossible
combinations by adding all the negatives and all the positives; here
it will return -5 and +18 which shows that 7 can be ruled out as it is
larger than the absolute value of the sum of negatives. On the other
hand, -2 and -3 must be included in any combination as the absolute
value of the sum of these equals the smallest positive number, 5.

If you have many rows you'll have to find some smarter routines as the
number of combinations increase dramatically.

/gustav


> This is one for the math guys who code. I have a situation where I need to take a field in a group of records and see if any combination of the values in the field equal zero.

> Example:

> MyField
>    5
>   -2
>    7
>   -3
>    6

> This group of records would have a combination that equals zero (5, -2, -3). I hope someone has something. 



More information about the AccessD mailing list