Forum Discussion

Nformation's avatar
Nformation
Contributor
10 years ago
Solved

How do I check if a returned SQL field is null in jscript?

I need to check if a certain field returned from a SQL query is null. I can't find an "IsNull" function and checking for length==0 gives me a type mismatch error. How should I handle this? Thanks.



... 


connection.CommandText = query;


queryResults = connection.Execute();

...


queryResults.MoveFirst();


satDate = queryResults.Fields("SatisfiedDate").Value


        


        if( aqString.GetLength(satDate) == 0){      //error here!

              //stuff

        }




2 Replies

  • Haha, I immediately dismissed trying this and now I can't remember why.  I was looking for an IsNull function instead. Thanks >.<