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

Crystal Formula 1

Status
Not open for further replies.

needmoremoney

Technical User
Mar 30, 2005
123
US
Hello all,

I'm trying to pull records for only one type of record but crystal reports is pulling more then one.

whileprintingrecords;
If {ETax.tcode}="FITW" Then
{ETax.filingStatus}

...
Crystal will pull other codes also. This report has all my formula in one line. One line per employee. But the formula above creates more then one line per record.
I could not use the select expert since my next record is to pull from ETax.tcode = "NY".

Any help thanks.

Crystal Reports 8.
 
Where is this formula?

Crystal isn't creating any rows, it is simply displaying the data at the level your query is pulling it.

To limit the rows in the report to just the criteria you've specified, use Report->Selection Formulas->Record and place:

{ETax.tcode}="FITW"

Since you need more than that criteria, or perhaps your criteria changes for each row, we'll need clarification. Successful postst tend to include:

Database/connectivity
Example data (show examples of the fields data)
Expected output (what the eventual display needs to be)

-k
 
All my formula exist in one text box:

@firstname,@lastname,@address1,@address2,@ssn,@FITW,@STATE

Formula @FITW is:
whileprintingrecords;
If {ETax.tcode}="FITW" Then
{ETax.filingStatus}

Formula @STATE is:
Whileprintingrecords;
If (ETax.tcode)="NY" Then
(ETax.filingStatus)

The records shows something of the following:
Jane,Doe,123FAKESTREET,APT7,897668987,S,2
Jane,Doe,123FAKESTREET,APT7,897668987,M,2
John,Doe,456ADAMAVE,POBOX888,234442345,S,1
John,Doe,456ADAMAVE,POBOX888,234442345,S,2
...
I just need one line per employee. When I use the select expert, it still gives me two lines. How Can I have it as one line per employee?

I'm trying to say: Only if ETax.tcode equal FITW, then output the Filingstatus else do nothing.
 
It looks like the two employees in your sample have more than one filing status on record. I think you need to use another field, e.g., a date field, to determine which is the correct current status. You can either use conditional suppression, e.g.,

{table.date} <> maximum({table.date},{table.employee})

...in the section expert->details->suppress->x+2, or use group selection (report->selection formula->GROUP):

{table.date} = maximum({table.date},{table.employee})

...assuming you group on {table.employee}.

-LB
 
Group by the employee number or whatever uniqueness exists at that level, suppress the details, and place the fields in the group header.

-k
 
Thanks all for the help.

I can't get it working. Synapsevampire, your suggestion works great but the format that I needed it in is off a bit.

I'm going to trying to merge the two tables into one and then pull the data out. I think that might work. Sorry I just thought of that now. The tables are in a MS Access 97 db.

Thanks much all. Always a good helping hand here.

Night Night.
 
More simply, you might create a Query in Access using a UNION query, then base the report on the query.

-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top