Another method to check whether the string has no length is:
<cfif len(trim(Milestone)) GT 0>
</cfif>
John Haigh
-----Original Message-----
From: Bert Dawson [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 08, 2000 1:30 AM
To: Fusebox
Subject: RE: SQL and NULL values
CF has no concept of NULL - a string is either empty or not, so to just
check if milestone is empty, or has no length:
<CFIF Milestone IS ''>
or
<CFIF NOT Len(Milestone)>
Bert
ps If "Milestone" is a column in your "report" query, you don't need to
check if ParameterExists(Milestone), and anyway, you should use IsDefined
rather than ParameterExists
> -----Original Message-----
> From: Natasha Regehr [mailto:[EMAIL PROTECTED]]
> Sent: 07 December 2000 20:46
> To: Fusebox
> Subject: OT: SQL and NULL values
>
>
> Hi,
>
> I can't figure something out. I don't have a lot of
> experience with SQL so
> maybe you can help. I have a query that pulls records from a
> database. If a
> certain field returns a NULL value I don't want the header displayed,
> otherwise display the header. I have tried the following and none have
> worked correctly:
>
> Database:
> In the database the "Allow Nulls" box is
> checked. (if that
> makes a difference)
>
> Cold Fusion:
> <cfoutput query= "Report">
> <cfif ParameterExists(Milestone)>
>
> <u>Construction</u>: #Milestone#<br>
> </cfif>
>
> <cfif Milestone neq ' ' >
> <cfif Milestone neq " ">
> <cfif Milestone neq 'NULL'>
> <cfif Milestone neq NULL>
>
> With each of the above methods, the header is still displayed
> whether there is a value or not.
>
> Please let me know if you ever run into this problem,
> and any advice
> you can give.
>
> Thank you,
> Natasha
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists