Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

default NVL value..please help.

Status
Not open for further replies.

kuolung

Programmer
Sep 2, 1999
51
US
i want to print out default value to 0 if the field is NULL with this sql


<cfquery name=&quot;q_file_info&quot; datasource=&quot;mydns&quot;>
select nvl(html_files,'0') as html_files, nvl(pdf_files,'0') as pdf_files
from file_info
</cfquery>

<cfoutput>
HTML files : #q_file_info.html_files#
PDF files: #q_file_info.pdf_files#
</cfoutput>

how come it doesn't work? they still output nothing (blank) for both html and pdf files, instead of 0. is there another way to default NULL value? thank you so much.

 
Hi erle:
Can you check the query and make sure the recordcount is not 0.
If there is no record in the query, it will show nothing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top