473,404 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Find Lowest Price in Table

Hi
I have tables from 12 suppliers each of whom can supply the same part,
I need to be able to create a table or query containing a list of
suppliers who can supply at the lowest price for each item. I am
struggling with this, can anyone help.
Thanks
Patrick
Jan 9 '08 #1
6 5716
"Patrick Fisher" <in**@psoftuk.comwrote in message
news:21********************************@4ax.com...
Hi
I have tables from 12 suppliers each of whom can supply the same part,
I need to be able to create a table or query containing a list of
suppliers who can supply at the lowest price for each item. I am
struggling with this, can anyone help.
Thanks
Patrick
Use a totals query (click on the "totals" toolbar button), "group on" both
supplier and item, "min" on the price field.

Keith.
www.keithwilby.com

Jan 9 '08 #2
"Patrick Fisher" <in**@psoftuk.comwrote in message
news:4t********************************@4ax.com...
>I still do not understand how I can get the lowest value from 12
possibles
By grouping on the unique supplier ID and setting the query to return the
minimum value for that grouping. If you're not familiar with using the
"totals" button in queries then post back and someone will walk you through
it. Typically the SQL would look something like:

Select MySupplierID, Min(PriceField) As MinPrice from tblMyTable
Group By MySupplierID

Keith.

Jan 9 '08 #3

I can't be you so it must be me not making my question clear lets
start again:

I have 12 tables each containing up to 1000 parts the only difference
in these table is that the price field will or may be different, I
need to produce a table containing one of each of the parts with the
lowest price out of all 12 tables together with the relevant supplier
name.

Your answers suggest to me that you are assuming that there is only
one table or am I misunderstanding.

On Wed, 9 Jan 2008 14:52:13 -0000, "Keith Wilby" <he**@there.com>
wrote:
>"Patrick Fisher" <in**@psoftuk.comwrote in message
news:4t********************************@4ax.com.. .
>>I still do not understand how I can get the lowest value from 12
possibles

By grouping on the unique supplier ID and setting the query to return the
minimum value for that grouping. If you're not familiar with using the
"totals" button in queries then post back and someone will walk you through
it. Typically the SQL would look something like:

Select MySupplierID, Min(PriceField) As MinPrice from tblMyTable
Group By MySupplierID

Keith.
Jan 9 '08 #4

"Patrick Fisher" <in**@psoftuk.comwrote in message
news:3h********************************@4ax.com...
>
I can't be you so it must be me not making my question clear lets
start again:

I have 12 tables each containing up to 1000 parts the only difference
in these table is that the price field will or may be different, I
need to produce a table containing one of each of the parts with the
lowest price out of all 12 tables together with the relevant supplier
name.

Your answers suggest to me that you are assuming that there is only
one table or am I misunderstanding.

On Wed, 9 Jan 2008 14:52:13 -0000, "Keith Wilby" <he**@there.com>
wrote:
"Patrick Fisher" <in**@psoftuk.comwrote in message
news:4t********************************@4ax.com...
>I still do not understand how I can get the lowest value from 12
possibles
By grouping on the unique supplier ID and setting the query to return the
minimum value for that grouping. If you're not familiar with using the
"totals" button in queries then post back and someone will walk you
through
it. Typically the SQL would look something like:

Select MySupplierID, Min(PriceField) As MinPrice from tblMyTable
Group By MySupplierID

Keith.
You really should have only 1 table with a vendor ID field. But you can
simulate this with a union query. Add a union for each vendor with a
calculate field for the vendor ID.

SELECT DISTINCT "V01" AS VendorID, tblPartsVendor01.[PART],
tblPartsVendor01.Price FROM tblPartsVendor01;

UNION ALL SELECT DISTINCT "V02" AS VendorID, tblPartsVendor02.[PART],
tblPartsVendor02.Price FROM tblPartsVendor02;
....

UNION ALL SELECT DISTINCT "V03" AS VendorID, tblPartsVendor03.[PART],
tblPartsVendor03.Price FROM tblPartsVendor03;

Then use the union query as the source to your selection query, Assume the
above query is name qryPartsVendor

SELECT qryPartsVendor.VendorID, qryPartsVendor.[PART],
Min(qryPartsVendor.Price) AS MinOfPrice
FROM qryPartsVendor
GROUP BY qryPartsVendor.VendorID, qryPartsVendor.[PART];
Jan 9 '08 #5
"Patrick Fisher" <in**@psoftuk.comwrote in message
news:3h********************************@4ax.com...
>

Your answers suggest to me that you are assuming that there is only
one table or am I misunderstanding.
Yes and no. The answer, as Ron states, is to either use a union query or
combine the 12 tables into one.

Regards,
Keith.
www.keithwilby.com

Jan 9 '08 #6
"Patrick Fisher" <in**@psoftuk.comwrote in message
news:qr********************************@4ax.com...
>I have combined the table into a single table.
<snip>
There is only one price per part in each table
???

Ron's query will work, are you sure you have Min and Group By in the
appropriate fields and all of the data in one place?

Jan 10 '08 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Brian Newsham | last post by:
------=_NextPart_000_004F_01C352B1.E5B8FA20 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I'm working on a PHP based website that loads...
3
by: Geoff Cox | last post by:
Hello, I would like to get into programming for Windows but am confused as to the best/lwoest price way to start. I am looking for software which would licence me to sell the code. What is...
3
by: Gigi.com | last post by:
Hi All. I need some help trying to pull prices from a price matrix. Here's an example: >>>> 1000 1500 2000 2500 ----------------------------------------- 1000 ¦ 10.20 ...
2
by: cs8404 | last post by:
I cannot quite figure out how to accomplish the following results. My table is "Products" with the following fields: ID Item Metal Size Price 1 Ring 18ctGold 4-7 $23.00...
8
by: Dag Sunde | last post by:
Imagine a mess of div-elements nested inside each other some relative, some absolute. Some of them grows when their children grows... And at some point, I want the x-coordinate of the bottom...
5
by: owz | last post by:
Hi again had some more problems, all help welcome. Access 2000, SQL My problem is as stated in the title. I want 2 display the highest and lowest priced car sold for this month. This is what I...
2
by: gizelle2101 | last post by:
I've read the articles, but nothing is working. My database just lists jewelry by type and gems. I want to pull out the most expensive piece and the least expensive piece in one query. <code> ...
0
by: 1 | last post by:
Dear friend, we sell all kinds of laptops and guitars . our product is a quantity best, the price is the lowest in the world, i think you will be interested in our product . thanks a lot! Our...
15
by: kpfunf | last post by:
I have one table of transactions, another table of price quotes. Transactions are nearly daily; quotes are periodic, roughly once per week. In a query, I want to pull the oldest (or least date)...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.