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  dBforums > PC based Database Applications > Microsoft Access > Need a formula to determine the lowest price

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-23-11, 14:15
tomdig tomdig is offline
Registered User
 
Join Date: Nov 2011
Posts: 4
Question Need a formula to determine the lowest price

I have3 vendor databases that have a manufcaturer part # as the common item.
I am trying to determine a formula that displays the lowest price amongst the 3 and only the lowest price. here is an example:

Headers
Distributor 1 Part# Price
JOE INC 12345 45.00
SAM INC 12345 48.50
JIM INC 12345 42.75

So amongst these 3 I would want to only show the $42.75 and JIM as the distributor.
I would like to do this in the builder in the query,. Any ideas help or suggestions are appreciated!
Reply With Quote
  #2 (permalink)  
Old 12-23-11, 14:47
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,250
merge the data into one table
then run a query which identifies the lowest price

eg
select top 1 Distributor, aColumn, PartNo, Price from mytable
where PartNo = 12345
order by Price ASC

if your PartNo is Alphabetic / String / Text then

select top 1 Distributor, aColumn, PartNo, Price from mytable
where PartNo = "12345"
order by Price ASC

if you want to do a partial match on a string / text
select top 1 Distributor, aColumn, PartNo, Price from mytable
where PartNo like "12345*"
order by Price ASC
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
Reply

Tags
access, lowest price, queries

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On