If Null, Then 0 for required field

  • 6Views
  • Last Post 4 weeks ago
  • Topic Is Solved
0
votes
Korhan Mulcar posted this 4 weeks ago

Hi,

I have a "required field" and sometimes NULL values can be assigned to it. So I need to write an expression like IF NULL, THEN 0.

 

This expression doesn't work.

PaymentAmount == "" ? 0 : 0

 

The data types "DT_NUMERIC" and "DT_WSTR" are incompatible for binary operator "==". The operand types could not be implicitly cast into compatible types for the operation. To perform this operation, one or both operands need to be explicitly cast with a cast operator.

0
votes
Korhan Mulcar posted this 4 weeks ago

Now I checked and REPLACENULL(PaymentAmount,0) seemed to work.

Close