Retreving a certain Row

  • Thread starter Thread starter JP
  • Start date Start date
J

JP

I have a table as follows:

Id No
1234 56
1234 58
1234 60

I need only Row 2 which (No:58). Is this possible?

Thanks
 
Hi JP,
Why do you want Row 2? Because it's row 2? Because it's
the middle (average, mean, etc.) value of No for id=1234?
Because No=58 for id=1234? What happens when there are
more (or less) than 3 records for 1234 -you would want a
different row? Some other reason(s)?
I think you'll have to explain why you want that
particular record out of the sample set.
 
Hi JP

I would need a bit more info as to what you are trying to accomplish.

Best regards

Maurice
 
I am so sorry as I was not clear.

Here's my table.
Id Partno RepairDate
1234 59 1/1/00
1235 60 7/2/99
1236 61 7/3/00
1237 62 1/2/99
1238 63



I have a form which has data coming from the above table
which shows only the first record as that's the most
current one.

Is there anyway I could do a query to find out the
previous part number which is one before the current
record? Basically I need to get the details of 1235..

Thanks for the response!
 
You could do a query along the lines of

SELECT TOP 1 field1, field2, ...
FROM MyTable
WHERE Id < Idvalue
ORDER BY Id Desc
 
Back
Top