There are the following inquiries:
Copy Code code as follows:
Select IsNull (lastchanged, ') as lastchanged from vhhostlist where s_comment= ' test202 '
Originally, the ISNULL function has only one argument, which means to determine whether the value of this parameter is NULL, is NULL to return True, otherwise return false;
However, in SQL Server query statements, ISNULL requires two parameters, meaning that if parameter 1 is null, then parameter 2 is the return value of the IsNull function;
That is, the meaning of the query above is to query the value of the LastChanged field in the s_comment= ' test202 ' row in the Vhhostlist table, and return an empty string if it is null;
I remember when I did not understand this, encountered a situation: an order form, one of the fields is status, the order submitted when the status is null. In the program to make the following judgment, when it is null, display an audited hyperlink; when it is not empty, a string is displayed: already audited. The procedure was written in this way:
Copy Code code as follows:
If RS ("status") <> "then"
Response.Write "<span style= ' color:red; ' > Audit </span> "
Else
Response.Write "<a href=check.asp?id=" & RS ("id") & "> Audit </a>"
End If
In fact, such judgments are not prudent, RS ("status") <> "" does not mean that the RS ("status") is equal to have been audited, nor does it mean that RS ("status") <> "" Outside the situation is the state of the trial;
The most reasonable should be to use ISNULL (status, ') as status to check out the status, if the RS ("status") = "" is not the trial, this is certain to set up!