I have got a SELECT statement that returns a recordset, with one of its values being 'acId'.
acId is either null or an id number.
Eg. In the Microsoft sql server database table the value in the acId field for each record is either <NULL> or an id number acting as a foreign key.
The below if statement returns false when it should be returning true.
I have also tried doing the below after declaring the variable.
All of these if statements keep returning false when the acId is null which is wrong.
Could anyone shed some light on this situation for me please.
acId is either null or an id number.
Eg. In the Microsoft sql server database table the value in the acId field for each record is either <NULL> or an id number acting as a foreign key.
The below if statement returns false when it should be returning true.
Code:
var acId = sqlRS('acId');
if(isNaN(acId))
{
<code>
}
else
{
<code>
}
I have also tried doing the below after declaring the variable.
Code:
String(acId);
if(acId == "")
and without the String function i tried:
if(acId == null || acId == "" || acId == "null")
All of these if statements keep returning false when the acId is null which is wrong.
Could anyone shed some light on this situation for me please.