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

Rename Formula 3

Status
Not open for further replies.

Jeremyjm

Programmer
Sep 3, 2004
31
US
Hello,

I have a field named .PART_ID in a report and whenever this field comes up blank, I'd like to insert a "No Part ID Assigned" message. I've tried doing an IF statement but I always end up getting an "A boolean is required here" in the beginning of the formula. What am I doing wrong?

Jeremy
CR Developer 8.5
 
What does your "If" statement look like? The following should work:

If IsNull(Table.PartId) or {Table.PartId} = "" or {Table.PartId} = " " then "No Part Number Assigned" else
{Table.PartId}
If PartId is numeric, convert it to string in above formula.

MrBill
 
I'm still getting a boolean error. I didn't use the "or" statements in my formula. Is this correct?

If IsNull({WORK_ORDER_SCHED.PART_ID}) or {WORK_ORDER_SCHED.PART_ID} = "" or {WORK_ORDER_SCHED.PART_ID} = " " then "No Part Number Assigned" else
{WORK_ORDER_SCHED.PART_ID}



Jeremy
CR Developer 8.5
 
When I create a formula field using the above logic on a string field from a table, I do not get any errors. Are you using this logic in a formula field or elsewhere?
MrBill
 
Yes, you need the or. That looks good.

In the event there are any number of blanks in PART_ID, I would modify the formula slightly.

If IsNull({WORK_ORDER_SCHED.PART_ID}) or trim({WORK_ORDER_SCHED.PART_ID}) = "" then "No Part Number Assigned" else
{WORK_ORDER_SCHED.PART_ID}

Cheers,
-LW
 
I think you are creating the formula in the wrong area--perhaps in the record selection formula area, which requires a boolean, or a conditional formatting area. You should be creating this in the formula area. Go to insert->field explorer->formula->new and enter the formula there. The location of the field explorer may be different in different versions, or you may be able to access it directly by going to insert->formula->new.

Then you would drag the formula onto the report and use it instead of {table.PartID}.

-LB
 
That was my problem lbass, thank-you. Thanks for all your help. Crystal was basically dumped on my lap with minimal training. It's a great tool, I just need the company to get me some formal training!

Jeremy
CR Developer 8.5
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top