Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with a Min bid query

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
Hello,

I have a problem with this query

SELECT Min(bidAmount) AS price FROM BidHistory WHERE (((BidHistory.bidAmount) In (SELECT Min(BidAmount) FROM BidHistory WHERE BidAmount<10009999 and idproduct = 1560)))

It will always select min bid from the bidhistory table, the problem is, it will always give me the same value, if lowest bid is 210 it will always be 210, even though 2 bidders have bid more if you understand what I mean, if there are 2 bidders bidding then it should give me the min bid that has been bid on with that idproduct code....
 
I do update a different table products, i keep a track of the startprice and the price it has been bid to but this should not be the bid price unless someone else has bid up to that thats why i need to use the bidhistory table
 
So its like this is psuedo ,

select min(bidamount) from bidhistory where idproduct=1560 and the bid has also been bid on do give me highest bid out of the lowest bids before the highest bid of the same bidder..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top