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

Need to suppress NULLs and blanks 2

Status
Not open for further replies.

AZdesertdog

IS-IT--Management
Dec 2, 2003
88
US
CR8.5 with MSSQL2k

I have a report where I'm suppressing a text field if ALL of the associated text fields below it are missing.
I'm using the following supression formula (ugly, I know) which works fine almost all the time. Unfortunately I've found that occasionally there may be a blank instead of the usual NULL fields which keeps my field from suppressing when it should.

---suppression formula------
isnull({%PT STG 1})and isnull({%PT STG 1 NMR})and
isnull({%PT STG 1 S})and isnull({%PT STG 2})and
isnull({%PT STG 2 NMR})and isnull({%PT STG 2 S})and isnull({%PT STG 3})and isnull({%PT STG 3 NMR})and
isnull({%PT STG 3 S})and isnull({%PT STG 4})and
isnull({%PT STG 4 NMR})and isnull({%PT STG 4 S})and
isnull({%PT STG 5})and isnull({%PT STG 5 NMR})and
isnull({%PT STG 5 S})and isnull({%PT STG 6})and
isnull({%PT STG 6 MNR})and isnull({%PT STG 6 S})

The SQL expressions in the suppress formula all result in text values.

I know I can add something like "or {%PT STG 1}=''" for each expression but I have literally dozens of them in dozens of places. My question is, is there a short cut that I can use to convert the above suppression filter to include the blanks as well as the NULLs? Any help appreciated.

-DD
 
I don't think so. You could simplify by writing a set of boolians, each one saying something like isnull({%PT STG 1}) or length({%PT STG 1}) = 0. If this were called No-STG1, your test could be No-STG1 and No-STG2 etc.

There's also a database option to change all of your nulls to spaces or zeros, but this wouldn't really meet your needs.

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
If you go into your Report Options, from the File menu, you can activate "Convert NULL values to default", which will convert your null strings into blanks, meaning you can handle all of them with = "".

Keep in mind that this setting will also affect your number fields, converting nulls into zero.

Naith
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top