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!

how to check if a number field is null or blank

Status
Not open for further replies.

susanna123

Technical User
Jan 22, 2010
79
CA
I have a field called line number. The type on this field is number

I would like to suppress if there is there is no data showing.

I am trying to write the code in the section formula of a group header under the suppress section.


{Line.Line_number} = null is throwing an error indicating that a number, currency amount, boolean, date, time, date-time or string is expected here.

How should I correct this.

Thanks
 
i believe you may use the following as your suppression formula.

isnull({Line.line_number})
or TRIM(totext({Line.line_number}))=""
 
The formula you provided worked. this is what happens.
When i run the report for the line parameters.

For example: user types in for line: 1500 which is a sample threshold value

When the report runs it will show only values that are greater or equal to 1500 and highlights in blue.

There is a group header that shows what type of line it is.

If I run the report with line parameter as 0, it will return all values.

When I run it with anything greater than 0 and if there are no values for line, it still displays the group header. I don't want it to display if there is nothing.

However in the suppress formula when i type in: {Line.line_number} = 300
the group header does not show. When using formula:


isnull({Line.line_number})
or TRIM(totext({Line.line_number}))=""

it still gives me the group header

pls advice. thks
 
I think you should be testing for nulls in your suppression formula.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Any formual that hits a null will stop, unless the IsNull test is used.

[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
I have done that but it is still not working

This is the case:

The only issue I am now having is to not display the records if there are no instances. The report is saved with data. It is filtered based on 4 parameters:
location, start date/time, end date/time and max processing time.

The max processing time is placed in a suppresion formula because I would like to show the life time average.
When i run the report with only 0 as my processing time, it will return all records that are less than or equal to 0 which is all the records but highlight those that are only greater than 30 minutes in red. This is correct behaviour. However, when i run my record with 30 minutes (1800) as the max processing time in my parameter, it will display all records but suppress those that are less than 30 minutes. However when the field is being suppressed it shows blank space on the report. I would like to suppress the group header 1 but I have tried and cannot due to the record selection formula.
 
You can suppress sections as well as fields. Does that help?

You can also selectively suppress groups, in the mroe recent versions of Crystal. It always helps to give your Crystal version - 8, 8.5, 9, 10, 11 or whatever. Methods sometimes change between versions, and higher versions have extra options.


[yinyang] Madawc Williams (East Anglia, UK). Using Crystal 10 & 11.5 with Windows XP [yinyang]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top