When using the LIKE statement you need to provide proper wildcards unless
you want to match the exact string. For example, if you want to find an
occurrence of '#str_search#' in the 'Knowledge' column your query would look
something like this ...

SELECT PID, Date, Knowledge
FROM NXSKnow
WHERE Knowledge LIKE '%#FORM.str_search#%'
ORDER BY Date DESC

See SQL documentation for a listing of applicable wildcards and their use.

Steve


-----Original Message-----
From: miles [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 12, 2000 1:23 PM
To: [EMAIL PROTECTED]
Subject: searches failing...help.


Hi,

Ive got myself a tiny problem...which should be a snap for
you folks that are more skilled than myself right now...

<CFQUERY Name="knowledge" DataSource="ccmast">
select id, entered_date, synopsis, knowledge
from nxsknow
where knowledge = '#search_string#'
order by entered_date desc
</CFQUERY>

this query will fail each and every time with the following
error.

[microsoft][ODBC SQL Server Driver][SQL Server]TEXT and IMAGE datatypes
may not be used in the WHERE or HAVING clause, except with the LIKE
predicate and the IS NULL predicate.

HOWEVER when I change the WHERE statement to the following...

where knowledge LIKE '#search_string#'

I get no results.  It doesn't matter what I enter as a variable.
I should get something back....shouldn't I ?

The somewhat annoying part about this is if I change the where
statement to the following

where id = '#search_string#'

and id is equal to some number...this query works...and pulls up a
single record...or if I change the where statement to

where synopsis = '#search_string#'

and synopsis is equal to "site".   It returns nothing....it should
return something
because half the entries in this table half the word "site" in the
field synopsis.

And before you think that there's nothing in the table...there is plenty
of data.  What's up with this query...why is this happening ?  Any
clues ?

Miles.
----------------------------------------------------------------------------
--
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to