Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
I want to check if a value is Null, and if it is Null, I want to assign a value. This is what im trying:
if(IsNull([Stock]), [Stock] = 1, [Stock]) as [Stock]
Problem is, when I check the value the [Stock] = 0. So instead of making it 1 its 0.
How can I do this different?
if([Stock]=' ', 1, [Stock]) as [Stock]
Hi,
Did you try something like this yet:
If(IsNull([Stock]),0,[Stock]) AS [Stock],
Or If(Len([Stock])=0,0,[Stock]) AS [Stock],
Regards,
Sokkorn
All the non-null values turn into -1 for some reason when I use this.
Hi,
Does your [Stock] field have null value or not? And if [Stock] is null then what value you want to assign?
Regards,
Sokkorn
if([Stock]=' ', 1, [Stock]) as [Stock]
Thanks alot! this worked for me. But instead of [Stock]=' ' I could use IsNull([Stock]). But just putting 1 in the second field worked.