That did it!  As the other responses indicated, things can get confusing
between logical (boolean) comparisons and string comparisons.  I really was
trying to do a string comparison for the literal word "Yes".  As Stephen
Hait indicated, there were trailing spaces or something that was messing up
the statement.  I had been outputting the variable and it was showing up
fine.

Thx
----- Original Message -----
From: "C. Hatton Humphrey" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Monday, July 30, 2001 10:17 AM
Subject: RE: CFIF Confusion


> When in doubt, use Trim() and UCase() functions to make sure, so instead
of
>
> <cfif FIELD1 IS "Yes">
>
> try
>
> <cfif Trim(UCase(FIELD1)) IS "YES">
>
> See if that helps.
>
> Hatton Humphrey
>
> > -----Original Message-----
> > From: Ken Monroe [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 30, 2001 10:07 AM
> > To: CF-Talk
> > Subject: CFIF Confusion
> >
> >
> > Hello!
> >
> > I'm working with SQL Server 2000 and I have a query I'm confused about.
> > There's a field (FIELD1) that's defined as a VARCHAR.  The field
contains
> > either "Yes" or "No".  I SELECT all records and then want to display
> > somthing different if FIELD1 is a "Yes" or "No".
> >
> >   The following structure works:
> > <cfif FIELD1 IS NOT "No">
> >     Bunch of code
> > </cfif>
> >
> > This structure does not work:
> > <cfif FIELD1 IS "Yes">
> >     Bunch of code
> > </cfif>
> >
> > I've also notice that in SQL, if I do a:
> > SELECT     *
> > FROM         TableName
> > WHERE     (FIELD1 LIKE 'yes')
> > it works, but
> > SELECT     *
> > FROM         TableName
> > WHERE     (Field1 IS 'yes')
> > does not work...
> >
> > ???
> > Thx
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to