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

CF Is Null question

Status
Not open for further replies.

programmher

Programmer
May 25, 2000
235
0
0
US
I am trying to code my page so that if the value of one of my fields is blank, set the value of this field to 0.

My code is as follows:

<cfif arrival_time IS NULL>

<cfset arrival_time ='0'>

</cfif>

The error I get references an error resolving the parameter NULL.

I KNOW this can be done. What simple step am I missing???/
 
You can use this:

<cfif arrival_time EQ &quot;&quot;>
<cfset arrival_time = 1>
</cfif>

At the top of your page you want to set a default param:
<cfparam name=&quot;arrival_time&quot; default=&quot;&quot;>

Hope this helps. Yvette Ingram
Brainbench Certified
ColdFusion Application developer
 
TLeish,

Many thanks!!! This worked like a charm and resolved my issue!
 
Programmer:

Great! However, I'm not TLeish, I'm Yvette.

Happy ColdFusion Programming! Yvette Ingram
Brainbench Certified
ColdFusion Application developer
 
Oops!!! Sorry about that Yvette! I sent this response and TLeish's response within seconds of each other!!!

Thanks again!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top