Forums
This topic is locked
Not display a text if the DB field is empty
Posted 09 May 2003 12:55:31
1
has voted
09 May 2003 12:55:31 Dalton Gilson posted:
Hi everyone!I'm building ASP pages where there will be displayed information brought -- in a looping process -- from SQL Server databases - for each "turn" of the loop, there will be "titles" before each kind of info: for instance:
<i>Response.write "Your fax number: " & <objRS("faxnr"></i>
... but sometimes, some fields of a record may NOT contain any data, or a NULL (if those information are not "required".
So, the problem is specifically this: in this case, the "title" will appear ...followed by nothing!!!?!?...
Then I ask You gurus:
- HOW can I force that piece of text (what a called "title" NOT to appear, not to be displayed-IF-its correspondent field is empty, or NULL?
I'd like to thank You in advance, for your attention.
Dalton Gilson, Rio
Replies
Replied 09 May 2003 14:01:51
09 May 2003 14:01:51 Jonathan Danylko replied:
try this...
<b>Fax Number:</b>
<% if <%=(rsRecords.Fields.Item("faxnr".Value)%> <> "" then %>
<%=(rsRecords.Fields.Item("faxnr".Value) %>
<% else %>
None
<% end if %>
Hope this helps...
L8R,
Vitoman, M CIW D, MMCP
<b>Fax Number:</b>
<% if <%=(rsRecords.Fields.Item("faxnr".Value)%> <> "" then %>
<%=(rsRecords.Fields.Item("faxnr".Value) %>
<% else %>
None
<% end if %>
Hope this helps...
L8R,
Vitoman, M CIW D, MMCP
Replied 09 May 2003 20:36:26
09 May 2003 20:36:26 Dalton Gilson replied:
vitoman
Thanks for your help!
Sincerely yours
Dalton
Thanks for your help!
Sincerely yours
Dalton
Replied 09 May 2003 20:56:28
09 May 2003 20:56:28 Jonathan Danylko replied:
Anytime... <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
L8R,
Vitoman, M CIW D, MMCP
L8R,
Vitoman, M CIW D, MMCP