We help IT Professionals succeed at work.

Display if field is NOT "" or NOT null

Aleks
Aleks asked
on
189 Views
Last Modified: 2017-04-04
I have the following code which will display a region if a recordset field is not = ""  (blank)
I need to add to it that is also NOT null.

<% If rs_contactalert.Fields.Item("contact_alert_type").Value <> ""  Then 'script %>

REGION

 <% End If %>   

Open in new window

Comment
Watch Question

Nitin SontakkeDeveloper
CERTIFIED EXPERT

Commented:
What is the database system? Why not solve it at the root itself? Add isnull(contact_alert_type, '') contact_alert_type in the select statement itself.

What do you think?

Author

Commented:
contact_alert_type  is the field of the recorset. if the field value is either NULL or ""  then the region won't be displayed. I am not clear what you are asking.
Nitin SontakkeDeveloper
CERTIFIED EXPERT

Commented:
Okay...how is the recordset created? There must be a select statement somewhere if it is the kind of web applications I have been developing.

Author

Commented:
its a simple select. I will change it so that if its NULL then it will make it ""  I can do that, but that was not the initial question for the IF statement.
Web Ninja at large
CERTIFIED EXPERT
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thanks. This is what I needed.