Avatar of Aleks
Aleks
Flag for United States of America asked on

Display if field is NOT "" or NOT null

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

ASPWeb Development

Avatar of undefined
Last Comment
Aleks

8/22/2022 - Mon
Nitin Sontakke

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?
Aleks

ASKER
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 Sontakke

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.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
Aleks

ASKER
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.
ASKER CERTIFIED SOLUTION
Big Monty

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Aleks

ASKER
Thanks. This is what I needed.