Joel,

It works for access and MS SQL... hmmm... have you made sure your "where"
clause is finding a row or rows to update? that "daily_date" might be a
problem.  What happens when you run the query directly from the command line
for MySQL?

-mk

-----Original Message-----
From: Joel Blanchette [mailto:cftalk@;pointofimpact.com]
Sent: Tuesday, November 05, 2002 3:48 PM
To: CF-Talk
Subject: RE: SQL Statement


Tried that and all that happens is that the number stays at 0.  When
that query is initialized, the column Raw_Hits and Unique_Hits already
has a value as Integer in a MYSQL Database.  Is there another way of
doing this?  All I need to do is add one to the columns.



==============================
Joel Blanchette
IT and System Specialist
Point of Impact Technologies Inc.
Tel: (204) 989-0013
Email: [EMAIL PROTECTED]
==============================


-----Original Message-----
From: Mark A. Kruger - CFG [mailto:mkruger@;cfwebtools.com]
Sent: Tuesday, November 05, 2002 2:21 PM
To: CF-Talk
Subject: RE: SQL Statement


Joel,

Put the column first in a math operation:


        UPDATE Statistic_Results#YearMonth#
        SET Raw_Hits =  Raw_Hits + 1,
        Unique_Hits = Unique_Hits + 1
        WHERE Domain_ID = '#DomainNameID#'
        AND Daily_Date = '#TodayDate#'


Assuming they are both int or numeric types - this will work.

-mk



-----Original Message-----
From: Joel Blanchette [mailto:cftalk@;pointofimpact.com]
Sent: Tuesday, November 05, 2002 2:09 PM
To: CF-Talk
Subject: SQL Statement


I have this VB SQL Statement and I need to change it to cf mysql

<CFQUERY NAME="SRUpdate" DATASOURCE="DomainDefault" USERNAME="joel"
PASSWORD="klrtl">
        UPDATE Statistic_Results#YearMonth#
        SET Raw_Hits = 1 + Raw_Hits,
        Unique_Hits = 1 + Unique_Hits
        WHERE Domain_ID = '#DomainNameID#'
        AND Daily_Date = '#TodayDate#'
</CFQUERY>

The problem lies when I do the column + 1.  Is there an easy way of
doing this without doing a new cfquery?



==============================
Joel Blanchette
IT and System Specialist
Point of Impact Technologies Inc.
Tel: (204) 989-0013
Email: [EMAIL PROTECTED] ==============================




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to