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

Crystal Formula? - problems

Status
Not open for further replies.

qu1ncy

Programmer
Jul 25, 2002
95
CA
Hi,
I'm suffering here. Hope you can refresh my memory. I'm pulling Employee data from an Oracle view. Each employee has many records reflecting changes (events) during their tenure such as being hired, merit increases, dept changes, etc. Each change is assigned a 'version' number (version) the highest of which represents the most recent change event, and an effective date (eff_date)the change took place. I need to create a formula which will pull past records 'as of' a parameter date. Meaning (I think I have the logic right), I need the maximum(version) of all records where the eff_date is less than the parameter date. But I don't know how to set this up properly. Any assistance will be much appreciated.
Thanks
Q
 
Use the following method.

1) Group your data by Employee
2) Group within that by EventCode
3) To get the last event of each code use a GROUP SELECTION formula of
{Table.EventDate} =
Maximum({Table.EventDate},{table.EventCode))

Editor and Publisher of Crystal Clear
 
I would approach it as follows:

1. Group by Employee and sort the records by Version within Employee.

2. Set a record selection formula of:
----------------------------------
{eff_date} < {?eff_date_parameter}
----------------------------------

3. Insert the fields you want to see in the Group Footer
(Employee) and suppress the detail section.

Since the Group Footer shows the last record within
the group, and since the records are sorted by Version,
you get want you want... :eek:)

Cheers,
- Ido CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thank you chelseatech, idomillet for your assistance. I'll give each suggestion a try.

Q
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top