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!

Basic Formula Language 1

Status
Not open for further replies.

JoePineapples33

Technical User
May 7, 2004
2
GB
Ayup,

As a relative newbie to formula writing I keep getting stuck on how to state what I want done in a formula.

If I want the report to exclude a certain field, but show others, what is the correct syntax for stating this?

I did a version of the following:

isnull (field) = "number" else (field) ?

How do I complete the formula?

Any help much appreciated. Ta.
 
What do you mean - "exclude a certain field"? Just don't put it on the report canvas.
 
Need basics such as

CR version
DB using
Connectivity

Could use examples of the detail and what you are expecting in the output so we can respond accordingly.

If you want to show some fields but not others, simply drag the fields you want into the detail section. If a given field is already null, it will show null.

Now if you want to prevent the showing of a particular value in a field, then create the following and place it in the detail section.

//formula
if {table.field} = "X" then
""
else
{table.field}

 
Sorry if I was being vague in my earlier post.

The following formula is fine:

if {table.field} = "X" then
""
else
{table.field}

How do I change it around to show the correct version of this?

isnull {table.field} = "X"
else
{table.field}
 
Isnull means there is nothing in the field, therefore it cannot = "X". What do you want to appear if a field is null? Here are some samples:

if isnull({table.stringfield}) then "" else
{table.stringfield} //leave blank if null

if isnull({table.stringfield}) then "No Record" else
{table.stringfield} //display message if null

if isnull({table.number}) then 0 else
{table.number} //show zero for null number fields

-LB
 
I keep trying to use this, but it keeps telling me that a statement is expected here and puts the cursor right after the then.
 
These formulas use Crystal syntax, and the error message is appearing because you have the format set to Basic syntax. In the formula editor tool bar, you need to change the syntax from Basic to Crystal.

-LB
 
Whoops!! Yes, I was using basic syntax, the message header was Basic Formula Language so I thought I was supposed to be using the basic setting!! Thanks for helping out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top