473,395 Members | 2,446 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

IsNull or = "" not working

I have a database that contains 3 plaque inscriptions in fields plaque, plaque2 and plaque3. I am trying to get my asp page to display only the plaques if there is data in the field. Some of the fields are null and some are just empty (no null value).

I have the following code, but I can't get it to work consistently:

Expand|Select|Wrap|Line Numbers
  1. <div class="personalizedPlaques" style="width: 185px">
  2.                       <p><%=rs("stock")%>Personalized <br />Engraved Plaque Ideas</p>
  3.  
  4.                       <ul>
  5.                      <% if (NOT ISNULL (rs("plaque")) And (rs("plaque"))="") then %>
  6.                          <li class="goldPlate"><span><%=rs("Plaque")%></span>
  7.                          </li>                     
  8.                       <% end if %>                        
  9.                       <% if (NOT ISNULL (rs("plaque2")) And (rs("plaque2"))="") then %>
  10.                         <li class="goldPlate"><span><%=rs("Plaque2")%></span>
  11.                         </li>
  12.                       <% end if %>
  13.                        <% if (NOT ISNULL (rs("plaque3")) And (rs("plaque3"))="") then %>
  14.                           <li class="goldPlate"><span><%=rs("Plaque3")%></span>
  15.                         </li>
  16.                       <% end if %>
  17.                       </ul>
This works if plaque3 is NULL but if I remove the NULL from the field, then nothing shows up. I've tried changing the And to OR and using IsEmpty insted of ="", but it only works when the fields are NULL.
Sep 18 '10 #1
2 1930
I fixed it. I could never figure out how to get a layered if statement to work, so ended up using LEN. This took care of it - works for Nulls or for blanks.
Sep 18 '10 #2
jhardman
3,406 Expert 2GB
I was going to suggest len, glad you figured it out on your own.

Jared
Sep 20 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Steven Scaife | last post by:
I have a quick question i tried searching google but couldn't find anything What is the difference between not isnull(val) and <> "" can this statement be reduced from If NumberDep <> "" or...
8
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have...
2
by: exsuscito | last post by:
After about 30 minutes of frustration I finally discovered what was causing a general 500 internal server error and to my surprise it was something I seem to always take for granted for its...
11
by: MLH | last post by:
DLookup("", "tblPreliminaryVINs", "=Forms!frmVINODO!SerialNum") is giving me a Type Mismatch error. That's confusing to me and I don't know how to circumvent it. The field in...
1
by: manchin2 | last post by:
Hi, Can anybody please provide the information about "&quot" and its use, if possible please provide an example. ...
3
by: AccessHunter | last post by:
I have to following VBA code, If IsNull(strSavePtyp) & "" Then rst.Delete End If The problem I am facing right now is, even when the value of strSavePtyp is "" (blank), the...
18
by: ryanvb83 | last post by:
I'm having some trouble with a particular form. I would like to lock a textbox until 7 other textboxes have a value in them. The other 7 textboxes are a mixture of text fields, double numers,...
4
by: fran7 | last post by:
Hi, from help in the javascript forum I found the error in some code but need help. This bit of code works perfectly, trouble is I am writing it to a javascript function so the height needs to be in...
4
kcdoell
by: kcdoell | last post by:
Hello: I have the following afterupdate event: Private Sub GWP_AfterUpdate() 'Updates the Total calculation in the control "SumGWP" on the quick reference 'table that is located on the form...
3
by: Shelly Bay | last post by:
Apologies. I am not an experience programmer so I suspect this is a very simple problem. I am trying to get a piece of code in VB for Access to recognise a null set but unfortunately the test is...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.