Update sitecount Set hits = hits + 1 Where id = xyz WG
> -----Original Message----- > From: Matthew Friedman [mailto:[EMAIL PROTECTED]] > Sent: 27 November 2002 15:19 > To: CF-Talk > Subject: SQL Question > > > I have a quick SQL question: > > I need to keep a running count of the time a specific location is > requested > and I could do it with 2 queries ie. > > <cfquery name="currentHits"> > select hits > from sitecount > where id = #idpassed# > </cfquery> > > <cfset new_hit = currentHits.hits + 1> > > <cfquery name="update_currentHits"> > update sitecount > set hits = #new_hit# > where id = #idpassed# > </cfquery> > > > But I was wondering if you could do it in a single statment since it is an > incremental variable. > > Thanks > > Matt > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

