Posted on 2006-03-24
Last Modified: 2013-12-24
Error Executing Database Query.  
[Macromedia][SQLServer JDBC Driver][SQLServer]Line 2: Incorrect syntax near '000.00'.  

73 :                         UPDATE Donations
74 :                               Set Amount = #dollarformat(rereplace(form.amount,"(\$)|(,)","","all"))#
75 :                         WHERE pledgeID = #getPledge.pledgeID# AND donationID = #getDonations.DOnationID#
76 :                   </cfquery>
77 :                   

SQL    UPDATE Donations Set Amount = $3,000.00 WHERE pledgeID = 219 AND donationID = 11676  

How do you correct this?
Question by:JohnLucania
    LVL 10

    Expert Comment

    dollarFormat takes a number string and formats is putting the $ , and . in the number.

    try using number format instead.
    LVL 10

    Assisted Solution


    UPDATE Donations
        Set Amount = #numberFormat(rereplace(form.amount,"(\$)|(,)","","all"), "9999999.00")#
        WHERE pledgeID = #getPledge.pledgeID# AND donationID = #getDonations.DOnationID#
    LVL 12

    Accepted Solution

    I've had better luck with:

    Set Amount = <cfqueryparam value="#numberFormat(REReplace(form.amount,"[^0-9.]","","all"), "9999999.00")#" CFSQLType="CF_SQL_DECIMAL" />
    WHERE pledgeID = <cfqueryparam value="#getPledge.pledgeID#" CFSQLType="CF_SQL_INTEGER" />
    AND donationID = <cfqueryparam value="#getDonations.DOnationID#" CFSQLType="CF_SQL_INTEGER" />

    But rob's answer is essentially what you'll want to do.

    Author Comment

    That is great!

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Article by: kevp75
    Hey folks, 'bout time for me to come around with a little tip. Thanks to IIS 7.5 Extensions and Microsoft (well... really Windows 8, and IIS 8 I guess...), we can now prime our Application Pools, when IIS starts. Now, though it would be nice t…
    When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now