HighDots Forums  

Only show if value is present

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Only show if value is present in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Shmooter
 
Posts: n/a

Default Only show if value is present - 08-02-2004 , 09:09 PM






How can I make both the value and the table row that holds the recordset value
ONLY SHOW IF there is a value in that particular item.

The recordset may have other items i want to show them I just want to ignore
and NOT display the null or empty values

Sorry about the re post I thought that I did a bad job of explaining my last
question.


Reply With Quote
  #2  
Old   
megajam02
 
Posts: n/a

Default Re: Only show if value is present - 08-02-2004 , 10:53 PM






Shmooter,
I'd like to know the answer to this as well. Maybe this will bump this topic someone will answer..

Chris

Reply With Quote
  #3  
Old   
Kindler Chase
 
Posts: n/a

Default Re: Only show if value is present - 08-02-2004 , 11:24 PM



megajam02 wrote:
Quote:
Shmooter,
I'd like to know the answer to this as well. Maybe this will bump
this topic someone will answer..

Chris
Not knowing your server model, I'll give you the ASP version:

<table>
<%
'first declare a variable to hold the RS Value
Dim strRSValue

'begin loop code
Do While....
'assign variable during each loop
strRSValue = Trim(rsName.Fields.Item("Column2").Value)

'check if the RS Value has something to show
If strRSValue & "" <> "" Then
'then we have a value so show this row
%>
<tr>
<td><%=(rsName.Fields.Item("Column1").Value)%></td>
<td><%=(rsName.Fields.Item("Column2").Value)%></td>
<td><%=(rsName.Fields.Item("Column3").Value)%></td>
</tr>
<%
End If 'If strRSValue & "" <> "" Then

'end loop code
Loop
%>
</table>

HTH's
--
kindler chase
http://www.ncubed.com
Grooving with SuperInvoice

news://news.ncubed.com/support
n3 Support Group




Reply With Quote
  #4  
Old   
Jeff North
 
Posts: n/a

Default Re: Only show if value is present - 08-03-2004 , 09:36 AM



On Tue, 3 Aug 2004 01:09:03 +0000 (UTC), in macromedia.dreamweaver
"Shmooter" <webforumsuser (AT) macromedia (DOT) com> wrote:

Quote:
| How can I make both the value and the table row that holds the recordset value
| ONLY SHOW IF there is a value in that particular item.
|
| The recordset may have other items i want to show them I just want to ignore
| and NOT display the null or empty values
|
| Sorry about the re post I thought that I did a bad job of explaining my last
| question.
There are two ways of doing this.
1. either write code to test for the value and act accordingly.
2. set up the appropriate WHERE statement within you sql statement.

The 2nd method will return only 'valid' records so it would be
straight through processing of the data. Also, if you are retrieving /
manipulating large amounts of data then, usually, the resultant page
will be displayed faster.


Reply With Quote
  #5  
Old   
CarlGrint
 
Posts: n/a

Default Re: Only show if value is present - 08-03-2004 , 10:34 AM



The simple answer is to use an IF statement, but keep it simple.

In ASP

<% If recordsetname("columnname") <> "" Then %>
<%=recordsetname("columnname")%>
<% End If %>


Originally posted by: Shmooter
How can I make both the value and the table row that holds the recordset value
ONLY SHOW IF there is a value in that particular item.

The recordset may have other items i want to show them I just want to ignore
and NOT display the null or empty values

Sorry about the re post I thought that I did a bad job of explaining my last
question.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.