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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

when value is null

Status
Not open for further replies.

achai

MIS
May 23, 2000
71
US
&lt;cfquey datasource=.... name=&quot;thisname&quot;&gt;<br>select ID, date1, date2, date1-date2 as Slip<br>from table<br>order by ID<br>&lt;/cfquery&gt;<br><br>&lt;cfoutput query=&quot;thisname&quot;&gt;<br>&lt;tr&gt;&lt;td&gt;#dateformat(date1, &quot;mm/dd/yyyy&quot;)#&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;#dateformat(date2, &quot;mm/dd/yyyy&quot;)#&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;#numberformat(slip, &quot;999&quot;)#&lt;/td&gt;&lt;/tr&gt;.....<br>........<br>when date1 or date2's value in database is null. then it shows erro about slip. I'm thinking about use paramet, but forget how.<br>
 
You could use parameters like this:<br><FONT FACE=monospace><b><br>&lt;cfparam name=&quot;date1&quot; default=&quot;01/01/1990&quot;&gt;<br>&lt;cfparam name=&quot;date2&quot; default=&quot;01/01/1990&quot;&gt;<br></b></font><br>or you could use CFIFs for the output...<br><FONT FACE=monospace><b><br>&lt;cfoutput query=&quot;thisname&quot;&gt;<br>&lt;tr&gt;&lt;td&gt;&lt;cfif isdate(date1)&gt;#dateformat(date1, &quot;mm/dd/yyyy&quot;)#&lt;cfelse&gt;No date available.&lt;/cfif&gt;&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;&lt;cfif isdate(date2)&gt;#dateformat(date2, &quot;mm/dd/yyyy&quot;)#&lt;cfelse&gt;No date available.&lt;/cfif&gt;&lt;/td&gt;&lt;/tr&gt;<br>&lt;tr&gt;&lt;td&gt;#numberformat(slip, &quot;999&quot;)#&lt;/td&gt;&lt;/tr&gt;.....<br>........<br></b></font><br>Hope this helps...<br><br>DM<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top