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!

isnull() not working

Status
Not open for further replies.

aspnetuser

Technical User
Sep 9, 2004
273
US
I am using the following formula isnull(FIELDNAME) in a if statement to return a 0 if the field is null. It is not working for some reason when in fact the field is null. Is their another formula of null i could use to return a zero?

CR 8.5
IN UNIX DB

The formulas are in a subreport but that should not matter.
 
Could you try to reverse the logic? And say, for instance, [if not isnull ({table.field}) then .....]
 
It is showing null because the customer number in the main report does not have a customer number in this sub report's table. That is why i need to use a isnull() because 1/2 have the number but half do not.

I can't do a left outer join on the main report the subreport method is my only option.
 
Have you tried the following in the event there are blanks in the field?

isnull({table.field}) or trim({table.field}) <>
 
The reverse logic did not work.
When I try isnull({table.field}) or trim({table.field}) <> "" it says it must be a string?

Weird thing is it works if the report uses a single customer id prompt. it fails when i pick multiple customer ids. what else can i do to force the 0 when it is null because the customer id does not exist on the subreport that i am linking to in certain cases
 
Could you post the actual formula?

[yinyang] Madawc Williams (East Anglia, UK) [yinyang]
 
Try Right Click -> Format Field -> Number Tab ->Customize and set default to 0

Might try the same with File->Options->Fields->Number

 
Shared numberVar account := if isnull({fieldname}) then 0 else {fieldname};

does the fact that the customer id is not found in the db table behind this subreport. I need to say if that is not there then this field is null or 0...
 
Is that the entire formaula? Because when you are dealing with nulls, the order in which you check makes a difference.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top