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!

Crystal Report Formula Error

Status
Not open for further replies.

Meg09

Technical User
Jan 30, 2009
14
US
Hi,

I am trying to write an if/then statement in crystal reports, however I keep receiving an error message stating that a boolean is required. Here is my formula:

if {time_project_tasks.task_code} in ["WORK"] then ("003652252-070196") Or
if {time_project_tasks.task_code} in ["MGTGS"] then ("003652252-11111")
else ("0")

The error message appears right before the string of numbers. Any help would be appreciated. :)
 
if {time_project_tasks.task_code} = "WORK" then
"003652252-070196" else
if {time_project_tasks.task_code} = "MGTGS"
then "003652252-11111"
else "0"

Use an "else" and eliminate unnecessary parens and brackets. However, it sounds like you might be creating this in the wrong place. You should be creating a formula like this in the field explorer->formulas->new.

-LB
 
I had the formula written in the right spot, just not the correct format! Thank you for your help :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top