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

Help!! - Parameterised Report with Arrays and formulas

Status
Not open for further replies.

SamLN

Technical User
Apr 17, 2013
25
AU
Hi smart people,
I have a report which I am nearly there with but need some help to get it over the line.
kindly someone has helped with the record selection formula, but because I don't understand it, its making the rest of the report formulas difficult for me.

the reports purpose is to allow the user to select a start date and an end date and a service milestone (ie: 5yrs, 10 yrs, 15 years etc) and the report will display all of the staff who will reach a service milestone during the selected date, and the actual date and milestone achieved.

I have a {?start date} and {?end date} date parameter and a {?milestone} multi select parameter (which is: numeric, static, with values of 5,10,15,20,25,30,35 & 40)

selection formula is:
datevar array x;
numbervar i;
numbervar j := ubound({?Milestone});
for i := 1 to j do (
if not ({PERSON.START_DATE} in x) and
dateadd("yyyy",{?Milestone},{PERSON.START_DATE}) in {?Start Date} to {?End Date}then (
redim preserve x[1000];
x := date({PERSON.START_DATE})
));
{PERSON.START_DATE} in x and
isnull({PERSON.TERMINATION_DATE}) and
{PERSON.EMPLOYEE_NO} < 5000000.00

once I have my employees who have service milestones in the parameter date range I want to display:

1) the actual milestone date (which is based on the milestone they are reaching)
2) the anniversary group the employee falls into (5 yrs,10 yrs,15 yrs ,20yrs etc).

I need a smart person to confirm the selection formula is doing what I require (there may be more than 1000 records which I don't think it caters for) and
suggest a formula to show the actual milestone date and the milestone the employee reaches on this date.

TIA

Sam
 
Only you can tell if your selection is correct

Create a formula based on this

@display
Whileprintingrecords;

datevar array x;
numbervar i;
numbervar j := ubound({?Milestone});
for i := 1 to j do (
if not ({PERSON.START_DATE} in x) and
dateadd("yyyy",{?Milestone},{PERSON.START_DATE}) in {?Start Date} to {?End Date}then (
redim preserve x[1000];
x := date({PERSON.START_DATE})
));

Place in details and see if its is returning correct value

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top