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!

Selecting the first and last date within a group 1

Status
Not open for further replies.

relaxinjim

Programmer
Nov 20, 2005
6
US
I am using Crystal 9.
I am interested in selecting particular dates (the first and last date) within a group.
My report is organized as follows:

ID DATE OTHER DATA
GROUPED ID (100)
100 4/05 xxxxx
100 6/05 xxxxx
100 8/05 xxxxx

GROUPED ID (102)
102 2/05 xxxxx
102 7/05 xxxxx
102 8/05 xxxxx
102 9/05 xxxxx
102 10/05 xxxxx

GROUPED ID (113)
113 3/05 xxxxx
113 4/05 xxxxx
113 7/05 xxxxx
113 9/05 xxxxx

I have a sort in place which sorts by ascending ID Group then by ascending date within the group. I need to insert a selection which pulls just the first and last date (and the corresponding data).
After the selection I want the above sample to look as follows:

ID DATE OTHER DATA
GROUPED ID (100)
100 4/05 xxxxx
100 8/05 xxxxx

GROUPED ID (102)
102 2/05 xxxxx
102 10/05 xxxxx

GROUPED ID (113)
113 3/05 xxxxx
113 9/05 xxxxx

I think I have provided enough information but I could certainly by missing something. Any suggestions are appreciated.
Thanks
 
You did a good job of laying out the problem. Go to report->selection formula->GROUP and enter:

{table.date} = minimum({table.date},{table.ID}) or
{table.date} = maximum({table.date},{table.ID})

-LB
 
Thanks for the quick response. I'll test it out this evening!

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top