|
-
Jul 22nd, 2005, 08:44 AM
#3
Thread Starter
Frenzied Member
Re: Minimum values - code vs. SQL
Yes, Access 2000, & I've used Min in queries and use it in the code. Every query I've tried either returns all records but with the minimum value in the entire table (which would be zero) for every record, or the minimum value for each question, but not what's needed, which is the minimum value for each module in a particular question, including records that that have the same minimum value.
The table is basically (and I wouldn't have named fields these):
Code - 3 letter client code
Question - question
Module - analagous to a department
Value - double
There are 89 questions and 26 modules. A question is asked in 1 or more modules, possibly all 26. I want all and only records with the minimum value for every question/module combination.
Right now I'm doing nested loops that SELECT DISTINCT on question, the same for module matching that question, getting the min value there and inserting the records into a table. I haven't been able to come up with a query alone that will return the records.
Tengo mas preguntas que contestas
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|