Yes in the Query you would use:
#Costeach#

When displaying #Dollarformat(Costeach)#
AS LONG AS Costeach in a numeric field in the
database. If it is a MONEY this try using: 
#VAL(CostEach)# 



Randy Adkins
>>> [EMAIL PROTECTED] 05/24/02 09:16 AM >>>
OK, now I understand. Costeach is a number in the Access table.

However, is there any way to make the number, let's say 1300.50 appear
as $1,300.50 when displayed, but as 1300.50 (stripped the $, etc) when
updating? 

Thanks.

Robert O.

-----Original Message-----
From: Philip Arnold - ASP [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 24, 2002 8:23 AM
To: CF-Talk
Subject: RE: update a dollarformat field


> 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
> 


______________________________________________________________________
Get the mailserver that powers this list at http://www.coolfusion.com
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