First, thanks in advance to anyone who may be able to assist me.
I haven't worked with CF for 2+ years and am trying to get back to re-acquiring my skills in this language. Needless to say, I'm having a rough time.
Within a table, I have three fields that are of datatype "money". (I'm using MS SQL Server 2000; existing records were imported from MS Access)
Sample (money) field of cfform:
Within the action page, I define default values if no value was entered by user.
When trying to add a record, I continue to receive errors. I've made NUMEROUS attempts (these are just a few) to no avail.
//1st Attempt
Tried this within action, and received the following error "Invalid data '' for CFSQLTYPE CF_SQL_DOUBLE."
//2nd & 3rd Attempt
... I tried this, and received the following error: "Invalid data CONVERT(money, ) for CFSQLTYPE CF_SQL_DOUBLE. " I then put quotes around the Form fields (i.e. '#Form.curSalary#', and received the same only with "CONVERT(money, '')"
//4th Attempt
... I tried entering in values within those fields to see what would happen and I recevied the following error: Optional feature not implemented
I can edit a record with no problem. I even have the
following within the update portion: SET ... curSignOn=CONVERT(money,'#Form.curSignOn#') and the record is successfully updated. (However, I'm not sure if this is correct or if it will lead to future problems -- please let me know if this correct)
I don't want to change my fields to that of varchar. The field is a currency value and as such, I want its datatype to reflect it. I'm at a straight loss at what I could be doing wrong.
Any assistance is GREATLY APPRECIATED!!
Thanks,
Nicole
I haven't worked with CF for 2+ years and am trying to get back to re-acquiring my skills in this language. Needless to say, I'm having a rough time.
Within a table, I have three fields that are of datatype "money". (I'm using MS SQL Server 2000; existing records were imported from MS Access)
Sample (money) field of cfform:
Code:
<cfinput type="Text"
label="Sign On"
name="curSignOn"
required="no"
message="Sign On Bonus must be a valid numeric amount!"
validate="numeric"
validateAt="onSubmit,onServer"
size="10"
bind="{qryCandidateList.selectedItem.curSignOn}"/>
Within the action page, I define default values if no value was entered by user.
Code:
<cfparam name="Form.curSalary" default="0">
<cfparam name="Form.curSignOn" default="0">
<cfparam name="Form.curDeclineSalaryAmnt" default="0">
When trying to add a record, I continue to receive errors. I've made NUMEROUS attempts (these are just a few) to no avail.
//1st Attempt
Tried this within action, and received the following error "Invalid data '' for CFSQLTYPE CF_SQL_DOUBLE."
Code:
Values( ...
<cfqueryparam value="#Form.curSalary#" cfsqltype="CF_SQL_MONEY ">,
<cfqueryparam value="#Form.curSignOn#" cfsqltype="CF_SQL_MONEY ">,
<cfqueryparam value="#Form.curDeclineSalaryAmnt#" cfsqltype="CF_SQL_MONEY ">, ...)
//2nd & 3rd Attempt
... I tried this, and received the following error: "Invalid data CONVERT(money, ) for CFSQLTYPE CF_SQL_DOUBLE. " I then put quotes around the Form fields (i.e. '#Form.curSalary#', and received the same only with "CONVERT(money, '')"
Code:
Values( ...
<cfqueryparam value="CONVERT(money, #Form.curSalary#)" cfsqltype="CF_SQL_MONEY ">,
<cfqueryparam value="CONVERT(money, #Form.curSignOn#)" cfsqltype="CF_SQL_MONEY ">,
<cfqueryparam value="CONVERT(money, #Form.curDeclineSalaryAmnt#)" cfsqltype="CF_SQL_MONEY ">, ...)
//4th Attempt
Code:
<!--- I commented out the cfparam code for those fields --->
I can edit a record with no problem. I even have the
following within the update portion: SET ... curSignOn=CONVERT(money,'#Form.curSignOn#') and the record is successfully updated. (However, I'm not sure if this is correct or if it will lead to future problems -- please let me know if this correct)
I don't want to change my fields to that of varchar. The field is a currency value and as such, I want its datatype to reflect it. I'm at a straight loss at what I could be doing wrong.
Any assistance is GREATLY APPRECIATED!!
Thanks,
Nicole