thanks Don. my problem is reinserting the number now.. #firstnumber#.#lastnumber# i need to re insert the . period i have tried '.', ".", #.# +.+ With no luck
<cfset firstnumber=listfirst(#FORM.Proj_Num#,".")> <cfset lastnumber=IncrementValue(listlast(#FORM.Proj_Num#,"."))> <CFSET Proj_Num2 = (#firstnumber#.#lastnumber#)> any ideas? thank you -paul -----Original Message----- From: Don Vawter [mailto:[EMAIL PROTECTED]] Sent: Monday, October 29, 2001 9:34 AM To: CF-Talk Subject: Re: Val :: manipulating strings as numbers Do you mean select the highest number before the first dot and increment the number after the last dot? If so treat the number as a list and have firstnumber=listfirst(project_Num_number,".") lastnumber=listlast(projet_num_number,".") you can then find the max firstnumber and increment the last number If you have to check more than the first number I would suggest using listtoarray with a delimitter of "." and manipulating that ----- Original Message ----- From: "Paul Ihrig" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Monday, October 29, 2001 6:51 AM Subject: Val :: manipulating strings as numbers > ok i am having some problems trying to figure out how to do this > > i have all these project numbers, but they are not real numbers, but text. > like > > Project_Num_Number > 50001.01 > 500020.07.01 > 500051.02.03 > 900008.01 > 900009.00 > > in each case i need to select the highest number > then add one 1 to insert as a new number for that field. > > the way it is right now, my where stament are not selecting the right range. > it did work prevously when i had the Project_Num_Number fieeld converted to > number field in access. > > WHERE Val(Project_Num_Number) < 1351103 > WHERE Val(Project_Num_Number) < 600000 > WHERE Val(Project_Num_Number) < 900008.00 > > right now they are only selecting 90000 reange for all categories & it is > incrementing by 1 > but if the highest number for that section is > 900008.02 i need it to do 900008.03 NOT 900009 > > > if you have any idea what i need to do i would appreciate the help. > > thank you > > -paul > > <!--- > Select the highest project number > then will add +1 to it > to be inserted back into new project > we will also need to insert the updated number back into this table latter > with the project name, After the project is complete! > ---> > <!--- > Numbers in the 900000 range to be inserted > Type_of_Project > Billable (New Project No.)=1, > Billable (Sub No. to Existing Project)=2 > ---> > <CFIF (#FORM.Type_of_Project# EQ 1) OR (#FORM.Type_of_Project# EQ 2)> > <cfquery name="rs_Proj_Num" datasource="Project_Set_Up" dbtype="ODBC"> > SELECT Project_Num_Number > FROM tbl_project_num_Link > WHERE Val(Project_Num_Number) < 1351103 > ORDER BY Project_Num_Number DESC > </cfquery> > <CFSET Proj_Num = IncrementValue('#rs_Proj_Num.Project_Num_Number#')> > > <!--- > Numbers in the 500000 range to be inserted > Type_of_Project Marketing=3 > ---> > <CFelseIF (#FORM.Type_of_Project# EQ 3)> > <cfquery name="rs_Proj_Num" datasource="Project_Set_Up" dbtype="ODBC"> > SELECT Project_Num_Number > FROM tbl_project_num_Link > WHERE Val(Project_Num_Number) < 600000 > ORDER BY Project_Num_Number DESC > </cfquery> > <CFSET Proj_Num = IncrementValue('#rs_Proj_Num.Project_Num_Number#')> > > > <!--- > Numbers in the 600000 range to be inserted > Type_of_Project Admin=4 > ---> > <CFelseIF (#FORM.Type_of_Project# EQ 4)> > <cfquery name="rs_Proj_Num" datasource="Project_Set_Up" dbtype="ODBC"> > SELECT Project_Num_Number > FROM tbl_project_num_Link > WHERE Val(Project_Num_Number) < 900008.00 > ORDER BY Project_Num_Number DESC > </cfquery> > <CFSET Proj_Num = IncrementValue('#rs_Proj_Num.Project_Num_Number#')> > <cfelse> > <CFSET Proj_Num = 0> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

