[AccessD] Obtaining 2 lowest values in a row

Susan Harkins ssharkins at bellsouth.net
Sun Aug 29 18:40:39 CDT 2004


Do the values 100, 50, 25, and so on represent the same type of value? If
so, you should normalize the table, then it would be easy:

1	100
1	50
1	25
1	98
1	75
1 	66
2	96
2	100

And so on... 

In a case like this, I'd suggest exporting the table to Excel and using the
transpose feature to reorganize it -- then import it back into Access --
should be fairly straight forward. 

The totaling part is easy with aggregates once the data is normalized. 

If the values represent different types of data, you could still do the
same, but just use the imported table for totaling as you need it. But,
since you're adding the values, I suspect they do represent the same type of
value. 

Susan H. 

Group,

I have a table of records where I need to grab the 2 lowest values in a row.

For example:

1  100  50  25  98  75  66
2   98  100 45  63  51  21

so the result for row 1 would be 25 and 50 and the result for row 2 would be
21 and 45

I want to create a query that produces this result

1   75 (sum of 25 and 50)
2   66 (sum of 21 and 45)

Can anyone help?

---
Eric Barro
Senior Systems Analyst
Advanced Field Services
(208) 772-7060
http://www.afsweb.com 


--
_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list