Ask a Question related to Coldfusion Database Access, Design and Development.
-
Frec #1
Access update, CFLOOP, number increment
I have a table with four columns.
field0 | field1 | field3 | field10 (primary key)
L ABC 101 1
L ABC 101 2
L ABC 104 3
L ABC 104 4
L ABC 104 5
L ABC 104 6
L ABC 106 7
I need my code to add an incremental number to field3 based on field1:
<FORM ACTION="cfs_modification_act.cfm" METHOD="Post">
<CFQUERY NAME="NumberofRecords" DATASOURCE="CFACCESS">
SELECT * FROM tblFinal WHERE Field0='L' ORDER BY Field1 ASC
</CFQUERY>
<CFSET LINENUM = 0>
<CFLOOP QUERY="NumberofRecords">
<CFSET LINENUM=LINENUM+1>
<CFQUERY NAME="UpdateRecords" DATASOURCE="CFACCESS">
UPDATE tblFinal SET Field3='#NumberFormat(LINENUM, '00')#' WHERE Field0='L'
AND Field10=#NumberofRecords.Field10#
</CFQUERY>
</CFLOOP>
I'm having trouble in my where clause.
Frec Guest
-
cfloop over a list - how to increment
:( I'm trying to look over a bunch of form fields, all of which have the same name. I can't get the loop to increment to the next iteration. Here... -
increment using update
I would like to keep track of how many times each user logs in. When a user fills in the form information on my login.html page it activates a PHP... -
Increment row number starting at 1
I have an asp page which displays database results in a table - (this is an invoice page). I have a variable called Row_Num which stores the row... -
Auto Increment a number field
I have a memo field (History) and a number field (Count). What I require is that when the history field is updated then the count field will... -
Increment a number in a text field
I'm having problems getting a text field to automatically increment, exp. when you add a record to a form, it should automatically give a new id...



Reply With Quote

