Data Management Group
Company Professional Services Solutions Technology Expertise Training & Education Resources
Resources










Contact Us

BI Advantage Newsletter

 

 

ISNULL FUNCTION

The information in the article refers to
Crystal Reports

Applies to
All versions
Conditional formulas
Formula evaluation
IsNull function


Synopsis
The Isnull function is used in a formula such as the following:

If {database.field} = somevalue or
Isnull({database.field}) then
"Yes"
Else
"No"

However, the fields that are null are completing the action after the "Else" statement rather than the "Then" statement.


Solution
The IsNull function is the second condtion in the formula. The IsNull function must always be used FIRST in a formula for it to be evaluated properly.

SQL Expression field versus a Crystal Reports formula field
Often an SQL Expression field and a Crystal Reports formula field can accomplish the same goal. For example, a report design requirement is to display the first 3 letters of the first name of an employee. A formula field or an SQL Expression field can fulfill this requirement. The advantage of the SQL Expression field is that the processing of the request will be done on the database server instead of in the Crystal Reports Designer. This results in a faster processing time.

Example
If
IsNull({database.field}) or
{database.field} = somevalue then
"Yes"
else
"No"



Questions
Have a question for our trainers?
Click here to send your questions!

 


COMPANY | PROFESSIONAL SERVICES | SOLUTIONS | TECHNOLOGY EXPERTISE | TRAINING & EDUCATION | RESOURCES