473,480 Members | 2,347 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

query to return minimal product of two fields

To return a minimal price of a bottle of vodka stored in field "price" I
can call MIN function .

However this price ignores the size of the bottle.
Bottle types and sizes are stored in a different table called "Bottles"

Suppose I wanted to get a product with the minimal price per litre.
Obviously I have to multiply the bottle price by the bottle size.

Can I do it in one query which will fetch the minimal per/liter price?
Jul 19 '05 #1
2 1478
Yes,

Showing the exact field names in each table would help write the SQL.

--
-dlbjr

Discerning resolutions for the alms
Jul 19 '05 #2
Thanks,
I have been given a tip to do like this:

SELECT Min([PriceTable].[Price] / [Bottles].[SizeInLiters])
FROM [PriceTable] INNER JOIN [Bottles]
ON [PriceTable].[BottleID] = [Bottles].[BottleID];
"dlbjr" <do******@do.u> wrote in message
news:eV**************@TK2MSFTNGP10.phx.gbl...
Yes,

Showing the exact field names in each table would help write the SQL.

--
-dlbjr

Discerning resolutions for the alms

Jul 19 '05 #3

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

Similar topics

3
1199
by: Ciar?n | last post by:
If I have table1 and table2, which both have the same fields Product and Qty. Can you help me with this query.... table1 has two rows Row 1 Contains ProductA with a Qty of two Row 2 Contains...
5
1487
by: Norma | last post by:
I am trying to make a query pull data from between the dates I enter in the parameter but also look back 'in time' to see where 2 other fields have null values, and only pull data into the query if...
6
29919
by: Martin Lacoste | last post by:
Ok, before I headbutt the computer... don't know why when I add criteria in a query, I get an 'invalid procedure call'. I also don't know why after searching the help in access, the various access...
10
4556
by: Lyle Fairfield | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbaac11/html/acfctNZ_HV05186465.asp "If the value of the variant argument is Null, the Nz function returns the number zero or a...
9
2879
by: Jimbo | last post by:
Hello, I have a user request to build a form in an Access database where the user can check off specific fields to pull in a query. For example, let's say I have 10 fields in a table. The user...
4
3692
by: Macroman | last post by:
MS Access XP, running on Win XP, Processor 2.4Ghz , 512Mb RAM, 40Gb Hard drive Table 1 has 167,000 records and contains the following fields tblone_custID tblone_easting tblone_northing ...
3
6101
by: starman7 | last post by:
I'm attempting a query that gathers product data for a particular product id. One of the items is designer(s) which can be more than one. The product table has comma separated id's of the...
4
1764
by: tweeterbot | last post by:
Hi, I am a chemical engineer trying to design a database and I am running into some trouble. My database is going to be 'processing' raw data to get the figures we need to prepare the monthly...
2
1526
by: BlackEyedPea | last post by:
Hi, I'm very very new to access but hopefully I'm learning quickly. I need some help on what I think maybe as a result of me having a little tunnel vision on my database & confusing myself. An...
0
7051
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
6915
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
7054
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,...
1
6750
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
6993
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...
1
4794
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...
0
2993
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1307
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.