473,657 Members | 2,407 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 2246
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
14134
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 appropriate document, or post an example? I don't relish the idea especially long if-else statements. Joe
7
3508
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 in a list box and submits the form the value is put into a session variable and the relevant page is displayed (in accordance to one of the list boxes). The page is then displayed with the relevant SQL data. So far i have got the
62
4094
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: ULcQb.466$KU5.37@nwrddc02.gnilink.net). Elsewhere there's been discussion about Microsoft SQL Server 2005 adding the CLR to support stored procedures in languages such as C#. A scan of the Web and discussion forums finds differing opinions about this.
5
6101
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 sequentially. Is that a trick of the debugger or is a switch quicker by O(n).
29
3563
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 one data field - but i'm not sure) :-) Background info:
5
6480
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 which other clauses are appended with AND. This all works fine as long as I provide a condition for the first clause
1
1331
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 form, assign the vaules to variables Rent_Location =Request.Form("varLocation") Rent_PropertyType=Request.Form("varPropertyType")
16
1557
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 muxclass.COM1Active =1 it will not exit the program??? Why is that can anyone help me Urgent!!!!!!
0
8323
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8838
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8513
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7351
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6176
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5638
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2740
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1969
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.