I've been racking my
brain for the past hour. I'm having trouble updating the values for each
record in COLUMN 3 all at once:
TABLE2:COLUMN
1
CheckID (autonumber)
1
2
3
CheckID (autonumber)
1
2
3
TABLE2:COLUMN
2
Reviews (int)
4
2
7
TABLE2:COLUMN 3
checkReviewCount (int)
0
0
0
Reviews (int)
4
2
7
TABLE2:COLUMN 3
checkReviewCount (int)
0
0
0
This is the Query
that I'm using:
<CFSET NewValue =
#checkCategory.ReviewCount# + 1>
<CFQUERY NAME="UpdateCounter" DATASOURCE="DB">
UPDATE TABLE2
SET ReviewCount = #NewValue#
WHERE CheckID = #checkCategory.CheckID#
</CFQUERY>
The
problem is that it will only add 1 to the first record and not the others. So
COLUMN 3 looks like this:
TABLE2:COLUMN 3
checkReviewCount (int)
1
0
0
checkReviewCount (int)
1
0
0
instead of
this:
TABLE2:COLUMN 3
checkReviewCount (int)
1
1
1
checkReviewCount (int)
1
1
1
Also, if this
manages to work, I need to stop the addition of 1, once the value in "Reviews"
equals the value in "checkReviewCount". (i.e. 4 = 4)
Thanks again
everyone. Gonna go soak my brain.
Arun Persaud
