Well when you want to set percentage to ZERO and discountedprice to
the value of price the just strip the quotes from your second SET-line
- assuming the two price-fields are database-fields.
But there has should be a WHERE-clause because else all fields in your
db will get updated.
<CFQUERY name="change" datasource="printprices">
UPDATE bookinfo
SET percentage = '#form.percentage#',
discountedprice = price
WHERE id = #form.id#
</cfquery>
HTH
Patric
RC> Take out the second set statement.
RC> <CFQUERY name="change" datasource="printprices">
RC> Update bookinfo
RC> SET percentage = '#form.percentage#',
RC> 'discountedprice' = 'price'
RC> </cfquery>
RC> There probably should be a 'WHERE' clause in there too, as well as u should
RC> be using cfqueryparam. Look it up in a book for the syntax, etc
RC> At 10:23 AM 3/30/2004, Robert Orlini wrote:
>>I have a query in an action page where I set a column to 0 (from a form)
>>and update discountedprice to the same value as price. Here is the code:
>>
>><CFQUERY name="change" datasource="printprices">
>>Update bookinfo
>>SET percentage = '#form.percentage#'
>>SET 'discountedprice' = 'price'
>></cfquery>
>>
>>I'm kinda a newy to all this so of course it doesn't work. I get an error
>>with -- SET 'discountedprice' = 'price'
>>
>>Any ideas please? Thanks.
>>
>>Robert O.
>>HWW
>>
>>
RC>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Update price Robert Orlini
- Re: Update price Ray Champagne
- RE: Update price Patric Stumpe
- RE: Update price Jeremy
- RE: Update price Dave Carabetta
- Re: Update price Thomas Chiverton
- RE: Update price Pascal Peters
- RE: Update price Robert Orlini
- RE: Update price Ray Champagne
- RE: Update price Robert Orlini
- RE: Update price Pascal Peters