DUH! Thanks Matt. I actually just did this in a query I wrote yesterday =). Yes this is definitely a better option than LIKE.
Eric -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Matt Woodward Sent: Thursday, November 04, 2004 2:14 PM To: [EMAIL PROTECTED] Subject: Re: query of a list Sorry, I may be completely misunderstanding what you're trying to do. Are you talking about using the list in your SQL query like this? SELECT * FROM students WHERE grade IN (#myList#) Depending on the data type of the items in the list you might have to use QuotedValueList on your list. Matt On Thu, 4 Nov 2004 14:09:53 -0600, Matt Woodward <[EMAIL PROTECTED]> wrote: > If you literally want to run a query on the list (but if it's just a > simple list I don't really see what benefit this gets you), you could > loop through your list and build a query object manually from your > list using QueryNew(), QueryAddRow(), and QueryAddColumn(). It might > be more helpful if you let everyone know what you're trying to do > overall because there might be a better way to go. (Not saying there > is, just saying there might be.) > > > > Matt > > On Thu, 4 Nov 2004 14:03:14 -0600, Kevin Fricke <[EMAIL PROTECTED]> wrote: > > i realize that, but what if i want to run a query on the list? > > > > for example > > > > select ID > > from Students > > where ???? > > > > I want to pull any student which has an A or B in the list. > > > > The grades field could have the following data "A,B,D,E" or just "A" > > > > Make any sense? > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > > Behalf Of Matt Woodward > > Sent: Thursday, November 04, 2004 1:51 PM > > To: [EMAIL PROTECTED] > > Subject: Re: query of a list > > > > ListFind will do the trick: > > <cfset myList = "1,2,3" /> > > <cfset myPos = ListFind(myList, 3) /> > > > > myPos will be set to the position in the list of the number 3, which > > in this case is 3. > > > > Hope that helps, > > Matt > > > > On Thu, 4 Nov 2004 13:45:10 -0600, Kevin Fricke <[EMAIL PROTECTED]> > > wrote: > > > I have a comma delimited list of numbers in a field. What is the language > > > for the query to see if a particular number is in that list?? > > > > > > Thanks! > > > > > > Kevin Fricke > > > > > > ---------------------------------------------------------- > > > To post, send email to [EMAIL PROTECTED] > > > To unsubscribe: > > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > > > To subscribe: > > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > > > > > > > -- > > Matt Woodward > > [EMAIL PROTECTED] > > http://www.mattwoodward.com > > ---------------------------------------------------------- > > To post, send email to [EMAIL PROTECTED] > > To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > > To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > ---------------------------------------------------------- > > To post, send email to [EMAIL PROTECTED] > > To unsubscribe: > > http://www.dfwcfug.org/form_MemberUnsubscribe.cfm > > To subscribe: > > http://www.dfwcfug.org/form_MemberRegistration.cfm > > > > > > > -- > > > Matt Woodward > [EMAIL PROTECTED] > http://www.mattwoodward.com > -- Matt Woodward [EMAIL PROTECTED] http://www.mattwoodward.com ---------------------------------------------------------- To post, send email to [EMAIL PROTECTED] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm ----------------------------------------- CONFIDENTIALITY NOTICE: The information contained in this e-mail and attached document(s) may contain confidential information that is intended only for the addressee(s). If you are not the intended recipient, you are hereby advised that any disclosure, copying, distribution or the taking of any action in reliance upon the information is prohibited. If you have received this e-mail in error, please immediately notify the sender and delete it from your system. ---------------------------------------------------------- To post, send email to [EMAIL PROTECTED] To unsubscribe: http://www.dfwcfug.org/form_MemberUnsubscribe.cfm To subscribe: http://www.dfwcfug.org/form_MemberRegistration.cfm
