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

How to select the 3rd record

Status
Not open for further replies.

qlan

MIS
Feb 10, 2005
84
US
Hello,

This is some of the data in my tblStatus:

StatusID ProjectNum EnteredDate
43947 9311DL 29-Jan-07
43960 9311DL 29-Jan-07
44175 9311DL 08-Feb-07
43961 9312JR 29-Jan-07
43986 9312JR 30-Jan-07
43968 9312JR 30-Jan-07
44022 9312JR 31-Jan-07
44024 9312JR 31-Jan-07
44109 9312JR 05-Feb-07
44268 9312JR 14-Feb-07
43979 9313DD 30-Jan-07
43980 9313DD 30-Jan-07
43981 9313DD 30-Jan-07
44007 9313DD 31-Jan-07
44029 9313DD 01-Feb-07
44055 9313DD 01-Feb-07
44072 9313DD 02-Feb-07
44092 9313DD 05-Feb-07
I am using CR10.

What can I do to only select the date of the 3rd record of every Project#? Thanks
 
Third based on what kind of sort? Insert a group on project number, and then try using the following if by third you mean the third from the earliest date:

nthsmallest(3,{table.date},{table.project})

-LB
 
I am sorry. What I need is to select the 3rd records from the earliest date NOT the 3rd Date. For example, based on the below sample data:
StatusID ProjectNum EnteredDate
43719 9244KK 11-Jan-07
43729 9244KK 11-Jan-07
43730 9244KK 11-Jan-07
43742 9244KK 12-Jan-07
43806 9244KK 17-Jan-07
43910 9244KK 26-Jan-07
What can I do to get
StatusID ProjectNum EnteredDate
43730 9244KK 11-Jan-07


Right now it gives me
StatusID ProjectNum EnteredDate
43806 9244KK 17-Jan-07

Thanks so much.
 
Actually, when I test my earlier suggestion, it would give you the desired result--it doesn't test for unique values, so should return 11-Jan-07.

-LB
 
For some reasons, mine did not give me 11-Jan-07. It gives me 11/17/07 using
nthsmallest(3,{tblStatus.EnteredDate},{tblStatus.ProjectNum}). Any help is greatly appriciated.

 
I can't explain that. You could also use conditional suppression. You would insert a group on project number, and also insert a running total {#cntwingrp} which counts a recurring field, evaluates for each record, and resets on change of group. Then go to the detail section and suppress the group header and footer. Then select the detail section->suppress->x+2 and enter:

{#cntwingrp} <> 3

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top