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

How can I extract current and previous months,combine them in a report

Status
Not open for further replies.

redshadow

Programmer
May 24, 2001
70
PH
I am writing one payroll report in Crystal and the situation is that there are two groups in the employee and each group has different payroll period.

I have to extract data for a particular group of employees from a previous month and combine it with group of employees for the current month.

Employees that must be extracted from the previous month are coded and starts with 0, the next group codes starts with 1, so I tried to use this formula under record selection formula:

{Lft.PAY_CODE} like '0*' and {Lft.PERIOD} = minimum({Lft_ttx.PERIOD}) or {Lft.PAY_CODE} like '1*' and {Lft.PERIOD} = maximum({Lft_ttx.PERIOD})

but it doesn't get to work as crystal states that Minimum and Maximum function cannot be used as it must be evaluated later.

I guess I cannot use minimum(month({Lft_ttx.PERIOD})) or for the other one as payroll period starts December of the previous year upto November the current year.

Any idea will be appreciated. Thanks.
 
by the way, I used Crystal 8 running on Windows 2000 and active data as a source for this report.
 
While you can't use minimum and maximum in a record selection formula, you can use them in a GROUP selection formula.

As the Group selection is done later int he processing cycle, any summaries will will need to be running totals or use variables to only include the required data.

Editor and Publisher of Crystal Clear
 
Yes, I tried it there too but after that I don't see any changes.

Since I have extracted two month-records, the amount is double once I put the formula in the group selection. I tried removing the summary from the group and put just the amount instead and some turns out to become 0 so I put the summary back.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top