What database - did I miss it? If its Oracle, the function is called
"lower()". So is SQLServer/TransactSQL.
If you're trying to do it in the CF Server, then it won't work, cuz you
can't lcase() a column name...
So, for Oracle, or SQLServer, do:
<CFQUERY NAME="GetData" DATASOURCE="HR">
SELECT PERSON_LAST_NAME
FROM TBL_PERSON
WHERE Lower(PERSON_LAST_NAME) LIKE Lower('#Criteria#%')
</CFQUERY>
Jason Blum wrote:
>
> Hmmm.. That is definitely consistent with the function described in
> Forta and elsewhere, but it still doesn't seem to work.
>
> Here is the actual query I am trying to use
>
> <CFQUERY NAME="GetData" DATASOURCE="HR">
> SELECT PERSON_LAST_NAME
> FROM TBL_PERSON
> WHERE PERSON_LAST_NAME LIKE '#Criteria#%'
> </CFQUERY>
>
> ...and I should be able to substitute
>
> WHERE LCase(PERSON_LAST_NAME) LIKE LCase('#Criteria#%')
>
> right?
>
> But no dice...
>
> Any thoughts?
>
> Thanks all!
>
> -----Original Message-----
> From: Jochem van Dieten [mailto:[EMAIL PROTECTED]]
> Sent: Friday, July 20, 2001 3:44 PM
> To: CF-Talk
> Subject: Re: >>>>> Using function inside Select statement
>
> SELECT FirstName, LastName
> FROM Names
> WHERE LCase(FirstName) LIKE LCase('#Criteria#')
>
> Use quotes around the criteria.
>
> Jochem
>
> Any yous guys know how to do dis?:
>
> SELECT FirstName, LastName
> FROM Names
> WHERE LCase(FirstName) LIKE LCase(#Criteria#)
>
> ...meaning whether they search for "bob" or "Bob" I want to return
> "Bob."
>
> But this doesn't work... Error code says 'invalid column name'
>
> Sos I thought maybe:
>
> SELECT LCase(FirstName) as LowerCasedName, LastName
> FROM Names
> WHERE LowerCasedName LIKE LCase(#Criteria#)
>
> ...but that dont work neither...
>
> tanks!
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists