Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

if statments and null values

Status
Not open for further replies.

Garabaldi

Technical User
Jan 16, 2002
61
CA
Hi,

I'm running into some problems with some code I'm writting.

I'm pulling one record from an sql table and that is going through fine... However there is one field in that record which may have a value of <NULL>. When I write this to a web page I want that field to read as &quot;Unavailable&quot; if it does have a <NULL> value.

This is my code so far:

If objADORS(&quot;OrigDueDate&quot;) = Null Then
sOrigDueDate = &quot;<blink>Unavailable</blink>&quot;
Else
sOrigDueDate = objADORS(&quot;OrigDueDate&quot;)
End If

This is where it writes:

<table><tr><td><% Response.Write sOrigDueDate %></td></tr></table>

I know the If statement is correct because I've tried it with the OrigDueDate field having a value of '1' and set up the if statement so that if it was equal to '1' to show as unavailable and it worked.

I would like to know how to set up the if statment to detect <NULL> values.

Thanks!!!
 


garabaldi,

If objADORS(&quot;OrigDueDate&quot;) = Null Then

Should be:

If IsNull( objADORS(&quot;OrigDueDate&quot;) ) Then


fengshui_1998
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top