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 Confusi
eh-oh:
SELECT *
FROM Wherever
WHERE somefield IS NULL
> That's because IS is not a valid SQL keyword...
~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprof
That's because IS is not a valid SQL keyword...
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...
~~~
I'm not certain why the SQL statements you noted below would work the way
they do, but it's possible that the fields are padded with extra spaces
around the "yes" which is causing a problem.
Converting the field type from varchar to integer will solve the problem.
---mark
==
>
> 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
Thats because the correct syntax for SQL would be:
WHERE F
You could check the value of the variable to see if it's really 'Yes'
or not:
FIELD1='#FIELD1#'
Note single quotes surrounding variable output. Check to see if
there might be trailing spaces - this might be the problem.
HTH, Stephen
> Hello!
>
> I'm working with SQL Server 2000 and I have
If you can change the data type of the Field1 you would be better to make it
a bit field and then use 1 for yes and 0 for no, then your CF logic and your
SQL will probably make more sense. Right now your trying to do String
Comparisons when what you really want to be doing by what you have put do
When in doubt, use Trim() and UCase() functions to make sure, so instead of
try
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
I would use type 'bit' for the field instead of varchar. Where 1 is yes and
0 is no, then in your if
check if it is EQ 1 or EQ 0.
Mike
Michael T. Tangorre
Web Applications Developer
Office Phone: 703-558-4746
Cellular Phone: 607-426-9277
AIM: CrazyF
9 matches
Mail list logo