[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Two select statements on one table getting an error upon posting to table

Posted on 2011-10-21
2
Medium Priority
?
136 Views
Last Modified: 2012-05-12
Hello,
  I need to run a query on a table that displays some information in a dropdown list and retrieves other information that will post to a new table upon submission.  Here is an example of what I am trying to accomplish:

                 Select LastName + ' ' + FirstName + ' ' + 'office ' + ' ' + Company AS Agent,Paynum,AssociateCell
              From tblUser
                   Where Inactive = '0' AND Role ='agent'
                    Order By LastName

When I try to post the data to a new table I get the following error:
Error Diagnostic Information
An error occurred while evaluating the expression:
#form.AssociateCell#
Error near line 64, column 37.
--------------------------------------------------------------------------------
Error resolving parameter FORM.ASSOCIATECELL
The specified form field cannot be found. This problem is very likely due to the fact that you have misspelled the form field name.

Below is the code on the submittion page
<cfoutput>
<cfquery name="addUser" datasource="HSO">
	Insert Into savings_card            			(FName1,LName1,FName2,LName2,Address,City,State,Zip,Email,Phone,TransType,Agent,AssociateCell,Affiliation,Rep,DateEntered)
       Value  ('#form.FirstName1#','#form.LastName1#''#form.FirstName2#',
           				'#form.LastName2#','#form.Address#','#form.City#','#form.state#',
            			'#form.zip#','#form.email#','#form.PhoneNumber#','#form.transaction#',
            			'#form.agentname#','#form.AssociateCell#','#form.affiliation#','#form.Rep#',
                        #date_added#)
         </cfquery>
 </cfoutput>

Open in new window

0
Comment
Question by:jdines
  • 2
2 Comments
 
LVL 16

Expert Comment

by:Sheils
ID: 37008594
First please confirm that you have check the spell including case (I notice that there is no consistency in the format of your control names, some start with capital some start with small letter).

Also make sure that the data type that you are entering in the form is an accepted data type in the table field
0
 
LVL 16

Accepted Solution

by:
Sheils earned 2000 total points
ID: 37008608
Also does the code work when you remove '#form.AssociateCell#'
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
This post looks at MongoDB and MySQL, and covers high-level MongoDB strengths, weaknesses, features, and uses from the perspective of an SQL user.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question