473,503 Members | 1,733 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

database if statement with conditions

229 New Member
Hi, I wonder if anyone can advise.
One database field is never empty as I have a text editor that inputs <P>&nbsp;</P> even if I dont actually put any text. I need to check with an if statement if the field has either <P>&nbsp;</P> and "<br>" & vbCrLf
and if so write, no data availabel and if not write the field text.


I have this but it doesnt seem to do the trick

Expand|Select|Wrap|Line Numbers
  1. <%
  2. If Trim(PDFavQuote) = "" OR Trim(PDFavQuote) = "<P>&nbsp;</P>" OR (strPDFavQuote) = "<br>" OR (strPDFavQuote) = "<br>" & vbCrLf Then 
  3. %> 
  4. nothing available
  5. <%
  6. Else
  7. %> 
  8.  
  9. <br><h2>statement</h2><%=rs("PDFavQuote")%>
  10. <%
  11. End If
  12. %>
Any help would be great.
Thanks
Richard
Apr 17 '09 #1
1 2242
fran7
229 New Member
Hi, just to say I worked it out and this does the trick.

Expand|Select|Wrap|Line Numbers
  1. <% If Trim(rs("PDFavQuote")) = "" OR Trim(rs("PDFavQuote")) = "<P>&nbsp;</P>" OR Trim(rs("PDFavQuote")) = "<br>" OR Trim(rs("PDFavQuote")) = "<br>" & vbCrLf Then 
  2. %> 
  3. There is currently no statement
  4. <%
  5. Else
  6. %> 
  7. <%=rs("PDFavQuote")%>
  8. <%
  9. End If
  10. %>
Thanks
Richard
Apr 17 '09 #2

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

Similar topics

26
14108
by: Joe Stevenson | last post by:
Hi all, I skimmed through the docs for Python, and I did not find anything like a case or switch statement. I assume there is one and that I just missed it. Can someone please point me to the...
7
3490
by: Guy Hocking | last post by:
Hi there, I have a problem in my ASP/SQL Server application i am developing, i hope you guys can help. I have a ASP form with list boxes populated by SQL tables. When a user selects a value...
62
4051
by: SAN3141 | last post by:
There doesn't seem to be consensus about when to put code in the database or in the middle tier. There was a long discussion about this in an Oracle newsgroup (message ID:...
5
6095
by: Alvin Bruney | last post by:
Is a switch more efficient than an if statement? I observe thru the debugger that a switch statement jumps directly to its case handler where as an if statement examines all conditions...
29
3537
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this...
5
6471
by: Dave | last post by:
I need to filter an Access 2000 result set in ASP 30 using the ADO recordset.filter. I build the filter in pieces. The first clause of the filter is this... WHERE word LIKE 'S%' ... to...
1
1323
by: leeperman | last post by:
I have an initial page with a form passing data (varLoaction and VarPropertyType to a second page. Details passed by post method Dim varLocation, varBeds, query 'Recieve the values from...
16
1542
by: cmdolcet69 | last post by:
I have the below if statement, that should catch if any of the conditions are met.....however for some reasons if my boolDSIFlushGapReading = true and MuxClass.DSIValues.count =1 and my...
0
7203
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
7281
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
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
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
7462
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
737
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.