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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

return values off recordset

Status
Not open for further replies.

gsc123

Programmer
Jan 24, 2008
197
0
0
If i use this query

SELECT TOP 2 bidhistory.bidAmount AS price FROM bidhistory WHERE (((bidhistory.idProduct)=1560) AND ((bidhistory.idCustomerBid)<>15)) ORDER BY bidhistory.bidAmount DESC


how do I get both values? or specify a particular value... ie; I want the second one
 
You need to select them, ie if you have a table that looks like this:

Name: tblMyTable
Field1: dataId
Field2: dataOne
Field3: dataTwo
Field4: dataThree

And try this:

select dataOne from tblMyTable where dataThree = myValue order by dataTwo asc

It won't work as all you are selecting is dataOne but trying to add a condition to dataThree and sorting by dataTwo.

--------
GOOGLE is a great resource to find answers to questions like "how do i..."

If you don't know exaclty what you want to do or what to search on, try Google Suggest: --------
I have recently been semi-converted to ensuring all my code (well most of it) works in both javascript and non-javasc
 
if I was to directly access 2nd field how would I grab it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top