Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

cfgridcolumn

Status
Not open for further replies.

saurabh

Programmer
Jul 10, 2000
27
IN
In CFGRIDCOLUMN i want to truncate values 1.00 to 1, but using numberformat attribute (_) is not working, it stops the showing of the grid result on the browser.<br><br>CFGRID is getting data from a DB query, which contains values as 1,2,3 and not as 1.00, 2.00.<br><br>suggest-------------
 
If setting numberformat parameter to _ or 9 is not working then is nothing else you can change in CFGRID because it is a total load of crap.<br>Much better to just use a table instead.<br><br> <p>Russ Michaels<br><a href=mailto:russ@satachi.com>russ@satachi.com</a><br><a href= Internet Development</a><br>For my personal book recommendations visit <br>
 
Dear InternetOverlord,<br><br>I am facing a problem, can u see the code and help me...the error<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br>ODBC Error Code = 37000 (Syntax error or access violation)<br>[Microsoft][ODBC SQL Server Driver][SQL Server]<br><br>Error converting data type varchar to numeric.&quot;---this line&quot;<br><br>The error occurred while processing an element with a general identifier of (CFQUERY), occupying document position (64:4) to (64:54).<br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br><br>Here i am using grid to update, insert and delete records from the database. I have marked the line 64 also....Code is down below:----<br><br>-----------------------------------------------------<br>&lt;cfset typename=ArrayNew(2)&gt;<br>&lt;cfset ro=1&gt;<br><br>&lt;!--- Database Query to retrieve FORM FIELD TYPES ---&gt;<br>&lt;cfquery name=&quot;f2&quot; datasource=&quot;max&quot; dbtype=&quot;odbc&quot;&gt;<br> select * from adm_type<br>&lt;/cfquery&gt;<br><br>&lt;!--- Putting DB values in an array. ---&gt;<br>&lt;cfoutput query=&quot;f2&quot;&gt;<br>&lt;cfset co=1&gt;<br>&lt;cfset typename[ro][co]=&quot;#adt_typeid#&quot;&gt;<br>&lt;cfset co=co+1&gt;<br>&lt;cfset typename[ro][co]=&quot;#adt_typename#&quot;&gt;<br>&lt;cfset ro=ro+1&gt;<br>&lt;/cfoutput&gt;<br><br>&lt;!--- Submitting the changes made in the FORM (GRID) CONTROL to the database ---&gt;<br>&lt;cfloop index=&quot;row&quot; from=&quot;1&quot; to=#arraylen(form.formgen.rowstatus.action)#&gt;<br>&lt;cfswitch expression=&quot;#form.formgen.rowstatus.action[row]#&quot;&gt;<br> <br>-----------------------------------<br>&lt;cfcase value=&quot;I&quot;&gt; &lt;!--- In case of INSERTION of records ---&gt;<br>&lt;cfset r=1&gt;<br>&lt;cfquery name=&quot;inst&quot; datasource=&quot;max&quot; dbtype=&quot;odbc&quot;&gt;<br>&lt;cfloop index=&quot;f&quot; from=&quot;1&quot; to=&quot;#arraylen(typename)#&quot;&gt;<br>&lt;cfif #form.formgen.adt_typename[row]# eq #typename[r][2]#&gt;<br><br>insert into adm_form (af_heading,af_subheading,af_name,af_typeid,af_size,af_order,af_mainid,af_templateid)<br><br>values('#form.formgen.af_heading[row]#','#form.formgen.af_subheading[row]#','#form.formgen.af_name[row]#','#typename[r][2]#','form.formgen.af_size[row]','#form.formgen.af_order[row]#','9','t4') <br>&lt;/cfif&gt;<br>&lt;cfset r=r+1&gt;<br>&lt;/cfloop&gt;<br>&lt;/cfquery&gt;<br>&lt;/cfcase&gt;<br><br>-----------------------------<br>&lt;cfcase value=&quot;D&quot;&gt; &lt;!--- In case of DELETION of records ---&gt;<br>&lt;cfquery name=&quot;de&quot; datasource=&quot;max&quot; dbtype=&quot;odbc&quot;&gt;<br>delete from adm_form where af_id='#form.formgen.original.af_id[row]#'<br>&lt;/cfquery&gt;<br>&lt;/cfcase&gt;<br> <br>-----------------------------------------<br>&lt;cfcase value=&quot;U&quot;&gt; &lt;!--- In case of UPDATE of records ---&gt;<br>&lt;cfset z=1&gt;<br><br>&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;line 64 down below&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;&quot;<br><br>&lt;cfquery name=&quot;upd&quot; datasource=&quot;max&quot; dbtype=&quot;ODBC&quot;&gt;<br>&lt;cfloop index=&quot;f1&quot; from=&quot;1&quot; to=&quot;#arraylen(typename)#&quot;&gt;<br>&lt;cfif #form.formgen.adt_typename[row]# eq #typename[z][2]#&gt;<br>update adm_form<br>set af_heading='#form.formgen.af_heading[row]#',<br>af_subheading='#form.formgen.af_subheading[row]#',<br>af_name='#form.formgen.af_name[row]#',<br>af_typeid=#typename[z][1]#,<br>af_size='#form.formgen.af_size[row]#',<br>af_order='#form.formgen.af_order[row]#',<br>af_mainid=9,<br>af_templateid='t4'<br>where af_id=#form.formgen.af_id[row]#<br>&lt;/cfif&gt;<br>&lt;cfset z=z+1&gt;<br>&lt;/cfloop&gt;<br>&lt;/cfquery&gt;<br>&lt;/cfcase&gt;<br>&lt;/cfswitch&gt;<br>&lt;/cfloop&gt;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top