WHERE ',' + name + ',' LIKE <cfqueryparam cfsqltype="CF_SQL_VARCHAR"
value="%,Ted,%">

The + is the concatenator and may be something else depending on your
db. If you have different values for that field, you might consider
using a related table instead of a comma delimited list.

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: vrijdag 5 maart 2004 10:48
> To: CF-Talk
> Subject: Querying a comma delimited field
>
> I have a field ("name") with a number of comma delimited
> values in it, say, "Bob,Carol,Ted,Alice". How can I query to
> find all the records that include the word "Ted"?
>
> <CFQUERY NAME="foo" DATASOURCE="bar">
> SELECT Address
> FROM personal
> WHERE name ???? "Ted"
> </cfquery>
>
> Thanks in advance for your help,
> Les
>
>
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to