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

where to insert the IF statement???

Status
Not open for further replies.

bloomlight

IS-IT--Management
Jun 12, 2006
149
US
I am writting a report using Crystal Report. And I don't know where or how to insert the IF statement. I have fields on the report with emp last name. Now, I need to make a report with:

If lastname start with 'B' then go to "Group-1"
else
go to "group-2"

any idea how to make IF statement to the query? where to instert the IF statement? I went to "Record Selection Formula Editor", but don't know where to put IF statement. Any help will be appreciated.
 
bloomlight,

You need a new Formula Field, which can then be used to define a Group within your report.

The syntax for specific inquiry is as follows:
Code:
IF Left({Table.LastName},1)="B" THEN "Group 1" ELSE "Group 2"

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top