> I must be missing some kind of syntax. Anyone can help please?
>
> I'm getting the error below when I do this update:
>
> <cfquery name="update" datasource="purchases">
> UPDATE purchases SET Costeach = #Dollarformat(Costeach)#
>
> on a field that is dollar formatted as:
> <input type="text" name="costeach"
> value="#Dollarformat(getpo.costeach)#"
>
> The error is:
> "An error occurred while evaluating the expression:
> #Dollarformat(Costeach)#
> Parameter 1 of function DollarFormat which is now "$300.00"
> must be a number
> The error occurred while processing an element with a general
> identifier of (#Dollarformat(Costeach)#),..."

First of all, what type of field is "Costeach" in the database? If it's
a number, don't take DollarFormat anywhere near it! - you also should
strip all "," out of the numbers as SQL treats them as a field separater

Starting a string with "$" means it's not a number, you should strip
those out before you do anything with them

Philip Arnold
Technical Director
Certified ColdFusion Developer
ASP Multimedia Limited
Switchboard: +44 (0)20 8680 8099
Fax: +44 (0)20 8686 7911

www.aspmedia.co.uk
www.aspevents.net

An ISO9001 registered company.

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************


> -----Original Message-----
> From: Robert Orlini [mailto:[EMAIL PROTECTED]]
> Sent: 24 May 2002 13:10
> To: CF-Talk
> Subject: update a dollarformat field
>
>
> Hello,
>
>
> Thanks,
>
> Robert Orlini
> 
______________________________________________________________________
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
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

Reply via email to