I am displaying a query with fields address1 and address2. I only want address2 to display if there is data in the database. The problem is my <cfif #trim(address2)# NEQ ""><br></cfif> isn't catching everything. When I look in the database their is nothing in the field. Less than 1% of the database has something in the address2 field. When displayed in my results sometimes it displays correctly other times it will not suppress the field.
<cfoutput query="Pharmacy">
<tr <cfif #currentRow# MOD 2>class="ODDTR"<cfelse>"ODDTR"</cfif>>
<td><font size="2"><strong>#name#</strong></font><br>
<font size="2">#address1# <br>
<cfif #trim(address2)# NEQ ""><br></cfif>
#city# #state# #zip#
<br>#phone#</font></td>
<!-- <td>#county# -->
<!-- <br>#city# #state# #zip# -->
</tr>
</cfoutput>
--Results of query---
LAC VIEUX DESERT HEALTH CENTER PHARMACY
23560 E. CHOATE RD.
WATERSMEET MI 49969
(906) 358-4588
THE MEDICINE SHOPPE #1263
200 EAST AYER STREET SUITE 2
IRONWOOD MI 49938
(906) 932-4500
WAKEFIELD PHARMACY
408 SUNDAY LAKE STREET
WAKEFIELD MI 49968
(906) 229-5966
Cathy
<cfoutput query="Pharmacy">
<tr <cfif #currentRow# MOD 2>class="ODDTR"<cfelse>"ODDTR"</cfif>>
<td><font size="2"><strong>#name#</strong></font><br>
<font size="2">#address1# <br>
<cfif #trim(address2)# NEQ ""><br></cfif>
#city# #state# #zip#
<br>#phone#</font></td>
<!-- <td>#county# -->
<!-- <br>#city# #state# #zip# -->
</tr>
</cfoutput>
--Results of query---
LAC VIEUX DESERT HEALTH CENTER PHARMACY
23560 E. CHOATE RD.
WATERSMEET MI 49969
(906) 358-4588
THE MEDICINE SHOPPE #1263
200 EAST AYER STREET SUITE 2
IRONWOOD MI 49938
(906) 932-4500
WAKEFIELD PHARMACY
408 SUNDAY LAKE STREET
WAKEFIELD MI 49968
(906) 229-5966
Cathy