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!

Group Selection for MaxDate

Status
Not open for further replies.

gleeb

IS-IT--Management
Feb 10, 2004
19
US
Hi,
Im using CR 10 connecting to an Access Db. I am wanting to select appointment records only if the maximum of one persons records fall within a certain date.

Example:
1 Gleeb 12/01/2004
2 Gleeb 02/05/2005
date parms = 12/01/04 thru 12/31/04

I have grouped on name then date and put in a group selection criteria of
{tblAppt.ApptDt} = maximum({tblAppt.ApptDt},{@Name})

I have record(report) selection criteria of {tblAppt.APPT_DATE} >= {?beg_date} and {tblAppt.APPT_DATE} <= {?end_date}

The problem is that the record selection occurs first then the group selection happens.
If I say I want to select anyone who has a maximum appt date from 12/01/04 to 12/31/04. It will select record 1 in the above example when I would like it to not select any records from this example because the maximum date for this person is actually 2/5/2005.

Any clues as to how I can do this?
 
Remove the record selection criterion and change the group selection criterion to:

maximum({tblAppt.ApptDt},{@Name}) >= {?beg_date} and maximum({tblAppt.ApptDt},{@Name}) <= {?end_date}

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
I think the following should work.

Remove {?end_date} criteria from your record selection.

In the group selection, use the following

maximum({tblAppt.ApptDt},{@Name}) in [{$beg_date} to {?end_date}]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top