Thanks Jim for wanting to help. I appreciate it. 

I actually used the <cfif len(Trim(Milestone)) GT 0> that was suggested by
John and it worked. 

Thanks guys,

Natasha

-----Original Message-----
From: Jim Nitterauer [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 08, 2000 6:40 AM
To: Fusebox
Subject: RE: SQL and NULL values


Natasha,

What type of drivers are you using and what type database are you connecting
to?

Ie, are you using ODBC, OLEDB, Native drivers?

Are you connecting to Access, SQL Server, Sybase?

Each type driver and database has somewhat different ways of storing and
returning null values from a data table and it makes a difference in your CF
Code. You might only have to do something like this:

<cfoutput> <!-- Don't use the query= here since it would loop if more than 1
record. use it if that's what you want --->
<cfif IsDefined("Report.Milestone") AND NOT Report.Milestone IS "">  <!---
Don't use ParameterExists anymore and scope your variables, no space between
the ""--->
        <u>Construction</u>: #Report.Milestone#<br>
</cfif>
</cfoutput>

Jim Nitterauer
Creative Data Concepts Limtied, Inc.
http://www.creativedata.net


-----Original Message-----
From: Natasha Regehr [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 07, 2000 2:46 PM
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

Reply via email to