Nformation
10 years agoContributor
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
}
...
connection.CommandText = query;
queryResults = connection.Execute();
...
queryResults.MoveFirst();
satDate = queryResults.Fields("SatisfiedDate").Value
if( aqString.GetLength(satDate) == 0){ //error here!
//stuff
}
- Try satDate == null.