That should work great... 1) Query Real Estate Agent IDs, ordered by sort value 2) cfloop over the query 3) Use queryName.currentRow *10 as the new sort value for each record
On Thu, Mar 13, 2008 at 12:13 AM, Rick Faircloth <[EMAIL PROTECTED]> wrote: > I think this might work... > > - to start, in db, 2 records, display-order values 10 and 20 > > - form submitted with display-order value of 15 > > - run insert query using value of 15 > > - now three records, display-order values 10, 15, 20 > > - run query to retrieve total recordcount > > - loop query with index and run internal update query setting each > display-order value to index*10 > > Am I missing anything? Any "gotcha's" in that approach? > > Rick > > > -----Original Message----- > > From: Sonny Savage [mailto:[EMAIL PROTECTED] > > Sent: Wednesday, March 12, 2008 11:12 PM > > To: CF-Talk > > Subject: Re: Best way to order appearance of database content... > > > > Use and indexed loop, multiply the loop count by 10 and use that value > for > > record insertion... > > > > On Wed, Mar 12, 2008 at 11:05 PM, Rick Faircloth < > [EMAIL PROTECTED]> > > wrote: > > > > > I know that doesn't sound like it's CF-related, but the solution > > > probably will be in CF, I'll bet. > > > > > > Anyway.I want to be able to determine the appearance order of > > > Real Estate agents on a page, other than by last name, etc. > > > > > > I want a user to be able to specify the appearance, say, by number. > > > I could have an "display-order" column and use a number. > > > > > > I would also want to have the numbers round up to the nearest 10 > > > whenever a new agent is entered or when an agent's display order is > > > updated. > > > > > > Say, I've got two agents in the db. First has display-order 10, > second > > > has > > > display-order 20. A third agent is added who is to be displayed > second, > > > so > > > is given the display-order number 15 in the form. When the form is > > > submitted, > > > the first agent retains number 10, the new second agent's number is > > > rounded up from 15 > > > to 20, and the agent whose number was 20 now has the number 30. That > way > > > there > > > are always values between the agents' display-order numbers to add new > > > agents. > > > > > > Make any sense? > > > > > > Would this be the best way to do this? Other ways? > > > > > > Thanks, > > > > > > Rick > > > > > > > > > > > > > > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;160198600;22374440;w Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:301145 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4