Thanks Adrian I had the cfset outside the query originally but that has the same result. All shirt numbers set to 10.
aor >It looks ok. The only thing I'd guess at is the cfset inside the cfquery. >Instead, but it outside. > ><cfquery name = "UpdateTeam" datasource = "#dsn#"> > Update Team > set Shirt = #playerShirt# ></cfquery> > ><cfset playerShirt = playerShirt + 1> > >Adrian > >http://www.adrianlynch.co.uk/ > >Hi, > >This seems like it should be pretty straightforward but I'm new to >ColdFusion and >cannot get this at all. > >I want to update a column in a database with an incremented variable in a >loop. I >want to be able to do this for a date column eventually (increment to next >day) but >I cannot get even this basic query below to work. > >The query is : > ><cfset playerShirt = 1> > ><cfloop condition = "playerShirt LTE 10"> > <cfquery name = "UpdateTeam" datasource = "#dsn#"> > Update Team > set Shirt = #playerShirt# > <cfset playerShirt = playerShirt + 1> > </cfquery> ></cfloop> > >What I want this to do is loop through the Team table starting at row 1 >and update >the players shirt number from 1 to 10. > >At the moment all shirt numbers are set to 10. > >Any guidance on this would be greatly appreciated. > >thanks in advance > >aor ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to date Get the Free Trial http://ad.doubleclick.net/clk;192386516;25150098;k Archive: http://www.houseoffusion.com/groups/CF-Newbie/message.cfm/messageid:3505 Subscription: http://www.houseoffusion.com/groups/CF-Newbie/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15
