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

Selecting the last record from a group of related records?

Status
Not open for further replies.

Dan01

Programmer
Jun 14, 2001
439
US
How can I set up an SQL statement where only the third record is selected out a group of related records in the first example. The record containing FieldB=9911300703.
FieldA FieldB FieldC FieldD
99113007 9911300701 19991130 20010904
99113007 9911300702 19991130 20001013
99113007 9911300703 19991130 20001013
In the next example, I want to select the second record, the record containing FieldB=9911300102.
FieldA FieldB FieldC FieldD
99113001 9911300101 19991130 20010904
99113001 9911300102 19991130 20001013
The key field is FieldA, and matches the first 8 bytes of FieldB. The last 2 bytes in Field B tracks the number of related records. Thanks, Dan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top