A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Need Min Value from Row and Heading Value that Corresponds to it.



 
 
Thread Tools Display Modes
  #1  
Old February 7th, 2010, 04:59 AM posted to microsoft.public.access.queries
JCowell
external usenet poster
 
Posts: 5
Default Need Min Value from Row and Heading Value that Corresponds to it.

I have a table that looks somewhat like this w/o the *'d headings:

h1 h2 h3 h4 h5 h6 h7 *Min Price *Heading
$5.00 $6.00 $3.00 $4.00 $9.00 $1.00 $9.00 $1.00 h6
$3.00 $6.00 $8.00 $65.00 $9.00 $2.00 $4.00 $2.00 h6
$4.00 $9.00 $5.00 $7.00 $1.00 $2.00 $8.00 $1.00 h5
$9.00 $7.00 $6.00 $3.00 $9.00 $8.00 $2.00 $2.00 h7
$7.00 $8.00 $9.00 $7.00 $9.00 $8.00 $8.00 $7.00 h1


I have several SKU's with various price contract/programs. I want to find
the best price in one cell and the heading that would correspond to that cell
in another.

I was trying to do this with an expression in a Query. Any help is greatly
appreciated.
  #2  
Old February 7th, 2010, 05:53 AM posted to microsoft.public.access.queries
Allen Browne
external usenet poster
 
Posts: 11,706
Default Need Min Value from Row and Heading Value that Corresponds to it.

See the MinOfList() function he
http://allenbrowne.com/func-09.html

To use it in your query, the expression to type into the Field row would be:
MinOfList([h1], [h1], [h2], [h3], [h4], [h5], [h6], [h7])

In the end, the problem is really with your table design. Repeating fields
violate basic relational design rules. You need many records instead of many
fields. For more info, search for 'normalization'. Here's a list of places
you could start:
http://www.accessmvp.com/JConrad/acc...abaseDesign101

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.


"JCowell" wrote in message
...
I have a table that looks somewhat like this w/o the *'d headings:

h1 h2 h3 h4 h5 h6 h7 *Min Price *Heading
$5.00 $6.00 $3.00 $4.00 $9.00 $1.00 $9.00 $1.00 h6
$3.00 $6.00 $8.00 $65.00 $9.00 $2.00 $4.00 $2.00 h6
$4.00 $9.00 $5.00 $7.00 $1.00 $2.00 $8.00 $1.00 h5
$9.00 $7.00 $6.00 $3.00 $9.00 $8.00 $2.00 $2.00 h7
$7.00 $8.00 $9.00 $7.00 $9.00 $8.00 $8.00 $7.00 h1


I have several SKU's with various price contract/programs. I want to find
the best price in one cell and the heading that would correspond to that
cell
in another.

I was trying to do this with an expression in a Query. Any help is
greatly
appreciated.


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:47 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.