Algebra, I guess

M

Mike

I have a list of 50,000 records of which two records need
to be removed. The olny thing I know about the two is that
their sum = 1160.09. How can I get Access to evaluate the
sum of any two of these records and determine which two
sumed together provides this result.
Thanks-Mike
 
T

Tonín

I suggest you can create a new query, select SQL view and paste the
following text:


SELECT [MyTable].[RecordID] AS Record1, [MyTable_1].[RecordID] AS Record2,
[MyTable].[NumberToSum] AS Value1, [MyTable_1].[NumberToSum] AS Value2,
[MyTable].[NumberToSum]+[MyTable_1].[NumberToSum] AS SumOfValues
FROM MyTable, MyTable AS MyTable_1
WHERE ((([MyTable].[NumberToSum]+[MyTable_1].[NumberToSum])=1160.09));

Then edit the text just to do the next changes:
Change "MyTable" to the actual name of your list of records, (and also
MyTable_1 to ActualName_1 )
Change "RecordID" to the name of the field you used to identify your records
(primary key)
Change "NumberToSum" to the name of the field containing the number to sum

I'm affraid because the size of your table, and probably the query is gonna
perform quite slow. I think it would be better if you try it first by
creating a little test table. Then you can decide if results satisfy your
needs.

The query will provide you a complete list of all pair of records that sum
1160.09

Kind regards,

Toni (Spain)
 
Top