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

'second pass' error - CrossTab 1

Status
Not open for further replies.

psimonnyco

Programmer
Jan 18, 2008
23
US
Hello

I'm running CR X against SQL Server.

I have a 'second pass' error and am looking for a simple solution without a custom view.

I have a transactional table with transactional data, sampled as follows.

EMPLOYEE, HOURS, PAY CODE
1, 40, REG
1, 2, REG
1, 10, OVT
1, 8 VAC
2, 40, REG
2, 10, OVT
3, 8 VAC

I'm doing a crosstab report to give me:

REG OVT VAC SUM
EMPLOYEE 1 42 10 8 60
EMPLOYEE 2 40 10 8 58
EMPLOYEE 3 8 8

I'd like to use the select expert on SUMOFHOURS >40 but can't. See below. Any ideas? Thanks.

1. Why does a formula produce the error?

"The function cannot be used because it must be evaluated later"?


Answer: This error usually happens when trying to insert a second pass function into a record selection. Since Crystal Reports evaluates record selection formulas during the first pass of the data, they cannot contain second pass functions.
 
You can use them for GROUP selection, however, by going to report->selection formula->GROUP.

-LB
 
Summaries. After inserting a group on employee, enter the following in the group selection area:

sum({table.hours},{table.employee}) > 40

-LB
 
I am probably just missing a step. See attached and thank you. "there must be a group that matches this field" error appears.


 
There is no attachment. Did you replace the fields in my formula with your actual fields? Did you insert a group on your employee field (you can suppress the group if you wish)?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top