Worked like a charm after I made a little mod... :-) > <CFIF NOT ListFind(lWork, lTemp)> > <CFSET ListAppend(lWork, lTemp)> > <CFOUTPUT>#lTemp#</CFOUTPUT><BR>
<CFSET lWork=ListAppend(lWork, lTemp)> Thanks much for your help!! Jeff ----- Original Message ----- From: "Michael Dinowitz" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, February 18, 2002 2:00 PM Subject: Re: Problems with a list > <!--- this will be our work list---> > <CFSET lWork=""> > <!--- loop over the query assuming the field we want is called list ---> > <CFLOOP query="whatever"> > <!--- remove the last element from the list stored in the DB field > ---> > <CFSET lTemp=listdeleteat(list, listlen(list, ';'),';')> > <!--- if the item is not already in the work list, add it ---> > <CFIF NOT ListFind(lWork, lTemp)> > <CFSET ListAppend(lWork, lTemp)> > <CFOUTPUT>#lTemp#</CFOUTPUT><BR> > </CFIF> > </CFLOOP> > We're setting a work list to see what we've already decided was going to be > outputted. We've outputted the unique entries. The result will be two lines > outputted, a list called lWork with the two entries that were outputted and > a lTemp with the last entry in it. This information is not important, but > you should ALWAYS know what you've set and what the environment is. > > At 01:39 PM 2/18/02, you wrote: > >I am having trouble figuring this out. I am having problems sorting with a > >query returning list values. > > > >Say my query returns these values from my table (actually list values with > a > >semicolon as a delimiter). The list is stored as plain text in one field > >that would be queried. > > > >1234;1234;1234;1 > >1234;1234;1234;2 > >1234;1234;1234;3 > >9876;9876;9876;1 > >9876;9876;9876;2 > >9876;9876;9876;3 > >9876;9876;9876;4 > > > >How can I output from that query: > > > >1234;1234;1234 > >9876;9876;9876 > > > >That output would be the distinct value minus the last list item. This is > >kind of like a distinct but different. To me it would seem like I could do > >it if there was a way to trim off the last list item but not sure what > >direction to go.. Any help would be appreciated... > > > >Thanks, > >Jeff > > > > > ______________________________________________________________________ Dedicated Windows 2000 Server PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER Instant Activation � $99/Month � Free Setup http://www.pennyhost.com/redirect.cfm?adcode=coldfusiona 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

