5 Replies Latest reply: Apr 12, 2012 3:02 AM by Reynald Liandra

# If(IsNull not working

Hi

I have this in my script and it should set a 1 to the fields that are blank:

If(IsNull(VERKVECKPER),1,VERKVECKPER) as VERKVECKPER,

I use a smiliar  If(IsNull(JCount),1,JCount) AS JCount, in another place and that works well. Anyone that noes way the first don`t?

As seen in below image the NewField should be 3 if the IF IsNull would work.

• ###### If(IsNull not working

try with

If(IsNull(VERKVECKPER) or VERKVECKPER='',1,VERKVECKPER) as VERKVECKPER

• ###### Re: If(IsNull not working

Hi,

Try If(IsNull(TRIM(VERKVECKPER)),1,VERKVECKPER)

OR

ISNULL() return -1 when the field is null and 0 when is not null

Try If(IsNull(TRIM(VERKVECKPER)) =  -1, 1,VERKVECKPER)

• ###### If(IsNull not working

Hi,

Null is different from blank

Check with this

If( Len(Trim(VERKVECKPER))=0 or IsNull(VERKVECKPER),1,VERKVECKPER) as VERKVECKPER,

• ###### If(IsNull not working

If(IsNull(VERKVECKPER) or VERKVECKPER='',1,VERKVECKPER) as VERKVECKPER as suggested from Juan seems to work at a first try. I will try the other suggestion as well.

Thanks!

• ###### If(IsNull not working

isNull() function returns true (-1) or false (0).

In your case, it should be:

If(IsNull(VERKVECKPER) = -1, 1, VERKVECKPER)

or

If(IsNull(VERKVECKPER) = 0, VERKVECKPER, 1)