you should have 2 tables, one for the records and one for the topics relate to the records. In
IE table records recordID (pri key) records table recordTopics topicID(pri key w/ foreign key relationship to your records table) topics Doug ----- Original Message ----- From: "Mark Leder" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Sunday, November 25, 2001 2:50 PM Subject: RE: Loop a db field > So how do I fix where the list of topics for one record could be 10 topics > or 60 topics or 100? Build 100 field to contain the data? > > Mark > > -----Original Message----- > From: Dina Hess [mailto:[EMAIL PROTECTED]] > Sent: Sunday, November 25, 2001 5:32 PM > To: CF-Talk > Subject: Re: Loop a db field > > > Each field in a properly structured relational database should contain > no more than one value. Fix that and your current "problem" goes away. > > ----- Original Message ----- > From: Mark Leder > To: CF-Talk > Sent: Sunday, November 25, 2001 3:24 PM > Subject: Loop a db field > > > I have an Access db with a field entitled "topics". This is a memo > field > with a comma separated list of text values, such as attitude, image, > change > management, etc. > > When I submit a form using a drop down box to pick the word > "attitude", how > do I set up the query on the results page to loop through all the > records in > that field to find and output the results of the word "attitude"? (I > need to > return all fields in the db for display purposes, such as name, > address, > etc.) > > <cfquery name = "q_foo" datasource = db1" > SELECT * from t_list > ORDER BY lastname > </cfquery> > > <cfloop .... </cfloop> > > Thanks, > Mark > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 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/cf-talk@houseoffusion.com/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists