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

If statements 2

Status
Not open for further replies.
Apr 7, 2003
31
US
I am trying to create a report that lists a social worker for a client.

I have a table that has a number of different practitioners listed, but I only want the social worker on this report.

So, I am trying to use the following:

IF {user_other_prac_grid.type_of_practitioner_Value} in ["Clinical Social Worker"] then
{user_other_prac_grid.practitioner_name_Value}
else
""

When I do this, I get the error "A boolean is required here" just before the IF.

Any ideas on how to get past this? It would be a great help, because there are a number of reports that I need to create that pull things the same way.

Thanks in advance for your help!
Jim
Wyoming State Hospital
 
How are oyu creating this formula? I think you are most likely in a record selection formula or some other place that requires a boolean formula rather than creating a new formula field.

Click on insert, field object, formula field and enter this formula and you should be fine.



Software Sales, Training, Implementation and Support for Exact Macola, eSynergy, and Crystal Reports
dgilsdorf@trianglepartners.com
 
IF {user_other_prac_grid.type_of_practitioner_Value} = "Clinical Social Worker" then
{user_other_prac_grid.practitioner_name_Value}
else
"";

I am assuming that one of the values of this field ...

user_other_prac_grid.type_of_practitioner_Value

is "Clinical Social Worker"


You don't use square brackets in Crystal syntax unless you are referring to an element of an array. You could still use like with a wildcard if necessary but it doesn't seem to be the problem here


Jim Broadbent
 
Thanks Jim and dgillz!

I realized (at 3am ) that I needed to create a formula for that, and not use it as part of the record selection formula. Did that and it works great!

Jim Johnson
IT Specialist
Wyoming State Hospital
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top