Hi All,
I am trying to get multiple values inserted into a database based on user selection of checkboxes.
I am getting a database error and not sure what is wrong with my code.
If someone has a minute I would sure appreciate another set of eyes to look at it and tell me what I am doing wrong. I is probably right in front of me but I have looked at it so many times I can't see it
Anyway...code here it goes
Form Page
.....
<input name="to_bill" type="checkbox" value="#GetTasks.TaskID#" />.....
Action Page
....
<CFLOOP INDEX="Checked_ITEM" LIST="Form.to_do">
<CFQUERY NAME="Billing" DATASOURCE="intranet" DBTYPE="ODBC">
INSERT INTO Billing(to_bill,projectid,taskid,customer,unit,name,jobtype,labor,
travel,totalhours,partnumber,partdescription,Qty,Price)
VALUES ('#Checked_ITEM#','#Form.ProjectID#','#Form.TaskID#','#Form.Customer#','#Form.Unit#','#Form.Name#','#Form.jobtype#','#Form.labor#','#Form.travel#','#Form.totalhours#','#Form.partnumber#','#Form.partdescription#','#Form.Qty#','#Form.Price#')
</CFQUERY>
</CFLOOP>
Error Message
...
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type varchar to numeric.
The error occurred in ....\action.cfm: line 86
84 : <CFQUERY NAME="Billing" DATASOURCE="intranet" DBTYPE="ODBC">
85 : INSERT INTO Billing(to_bill,projectid,taskid,customer,unit,name,jobtype,labor,travel,totalhours,partnumber,partdescription,Qty,Price)
86 : VALUES ('#Checked_ITEM#','#Form.ProjectID#','#Form.TaskID#','#Form.Customer#','#Form.Unit#','#Form.Name#','#Form.jobtype#','#Form.labor#','#Form.travel#','#Form.totalhours#','#Form.partnumber#','#Form.partdescription#','#Form.Qty#','#Form.Price#')
87 : </CFQUERY>
Thanks for the help
Sue
I am trying to get multiple values inserted into a database based on user selection of checkboxes.
I am getting a database error and not sure what is wrong with my code.
If someone has a minute I would sure appreciate another set of eyes to look at it and tell me what I am doing wrong. I is probably right in front of me but I have looked at it so many times I can't see it
Anyway...code here it goes
Form Page
.....
<input name="to_bill" type="checkbox" value="#GetTasks.TaskID#" />.....
Action Page
....
<CFLOOP INDEX="Checked_ITEM" LIST="Form.to_do">
<CFQUERY NAME="Billing" DATASOURCE="intranet" DBTYPE="ODBC">
INSERT INTO Billing(to_bill,projectid,taskid,customer,unit,name,jobtype,labor,
travel,totalhours,partnumber,partdescription,Qty,Price)
VALUES ('#Checked_ITEM#','#Form.ProjectID#','#Form.TaskID#','#Form.Customer#','#Form.Unit#','#Form.Name#','#Form.jobtype#','#Form.labor#','#Form.travel#','#Form.totalhours#','#Form.partnumber#','#Form.partdescription#','#Form.Qty#','#Form.Price#')
</CFQUERY>
</CFLOOP>
Error Message
...
Error Executing Database Query.
[Macromedia][SQLServer JDBC Driver][SQLServer]Error converting data type varchar to numeric.
The error occurred in ....\action.cfm: line 86
84 : <CFQUERY NAME="Billing" DATASOURCE="intranet" DBTYPE="ODBC">
85 : INSERT INTO Billing(to_bill,projectid,taskid,customer,unit,name,jobtype,labor,travel,totalhours,partnumber,partdescription,Qty,Price)
86 : VALUES ('#Checked_ITEM#','#Form.ProjectID#','#Form.TaskID#','#Form.Customer#','#Form.Unit#','#Form.Name#','#Form.jobtype#','#Form.labor#','#Form.travel#','#Form.totalhours#','#Form.partnumber#','#Form.partdescription#','#Form.Qty#','#Form.Price#')
87 : </CFQUERY>
Thanks for the help
Sue