Simple problem .... need help

# Thread: Simple problem .... need help

1. Senior Member
Join Date
Dec 1969
Posts
115

## Simple problem .... need help

As someone who is fairly new to ASP ... I am struggling with the very simple line of code... Please see below. Am I writing the null code right ??? Anything I try isnt working. Please help !!!!<BR><BR>&#060;%<BR>If Not rsSupplier("tariff") = ("NULL") Then<BR>Response.Write "&#060;tr&#062;&#060;td&#062;&#060;strong&#062;Yor kshire Tariff Code&#060;/strong&#062;&#060;/td&#062;&#060;td&#062;"

2. Senior Member
Join Date
Dec 1969
Posts
1,024

## RE: Simple problem .... need help

If Not rsSupplier("tariff") = "NULL" Then<BR><BR>or (the more likely solution)<BR><BR>If Not rsSupplier("tariff") = NULL Then<BR><BR><BR>cp

3. Senior Member
Join Date
Dec 1969
Posts
1,843

## RE: Simple problem .... need help

Null is very strange. If you say If Blah = Null do you want to know what the answer would be? It wouldn&#039;t be True or False, it would be Null.<BR><BR>So, to check for Null&#039;s you have to use the Built-In IsNull Function. You would do it like this: <BR><BR>If IsNull(rsSupplier("traiff")) = False Then<BR>Response.Write "&#060;tr..............<BR><BR>

4. Senior Member
Join Date
Dec 1969
Posts
11,247

## RE: Simple problem .... need help

If Not len(rsSupplier("tariff")& "")) = 0 Then

5. Senior Member
Join Date
Dec 1969
Posts
1,765

## RE: Simple problem .... need help

Use the IsNull Function. It returns boolean:<BR><BR>True: Value = Null<BR>False: Value &#060;&#062; Null<BR><BR>&#060;%<BR>If Not IsNull(rsSupplier("tariff")) Then<BR>Response.Write "&#060;tr&#062;&#060;td&#062;&#060;strong&#062;Yor kshire Tariff Code&#060;/strong&#062;&#060;/td&#062;&#060;td&#062;

6. Senior Member
Join Date
Dec 1969
Posts
2,050

if NOT ISNULL(rsSupplier("tariff")) then<BR><BR>completely off the top of my head, as I don&#039;t like to work with NULLS. I think they cause more problems than is necessary.<BR>~~Chaotix<BR>

7. Senior Member
Join Date
Dec 1969
Posts
2,050

## WOAH!

bored, guys? :)

8. Senior Member
Join Date
Dec 1969
Posts
1,765

## Hmmmmmm, Don't I feel slow! <eom>

.

9. Senior Member
Join Date
Dec 1969
Posts
1,843

## Nope.....

If Not rsSupplier("tariff") = NULL Then <BR><BR>will not work. Read what I wrote to the poster. VBS will evaluate that to NULL not to True or False. <BR><BR>You have to use IsNull()

10. Senior Member
Join Date
Dec 1969
Posts
1,765

## Lol!

.

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•