Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm missing the SQL "NULLIF" command when scripting. Looking for alternatives. Any suggestions?
Thanks /Joakim
sum
(isnull(oru.ordlevantal,0)* isnull(nullif(orp.artvikt,0),isnull(ar.artbtotvikt,0)))Hi
you can use rangesum()
rangesum(NULL) = 0
rangesum('A') = 0
rangesum(null,3) = 3
Or maybe use alt()
Check the help for more examples
Rgds
Thanks Héctor! I'll check it out //Joakim
Ok, so I was a bit fast to answer that it acctually worked.
SQL Example - isnull ( nullif ( table1.weight , 0 ) , isnull ( table2.weight , 0 ) )
I m looking for the weight in table1. If the weight is NULL or 0(zero) I'd like to go to table2 to look for the weight there - This effect I get by making the value NULL in table1 if it acctually is 0 - The ISNULL statement then looks in table2.
If the value is NOT NULL or 0 (zero) I do NOT want to go to table2
RANGESUM(2 KG,1 KG ) = 3KG - Expected result 2KG
I words - If it finds the weight in table1 I want it to disregard of whatever value it can find in table 2 - This is also done by the first ISNULL satement
Understandable?
Thanks / Joakim
Issue resolved - using rangeMAX ¨
//Joakim