Re: Inserting calculated values

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Roji. P. Thomas (lazydragon_at_nowhere.com)
Date: 08/10/04


Date: Tue, 10 Aug 2004 12:27:23 +0530

assuming all the elements in the formula are column names.

UPDATE invoice
SET calculatedprice = SUM((unitprice * (unit_qty /factor)) - ((unitprice *
(unit_qty
/factor)) * discount / 100))

-- 
Roji. P. Thomas
Net Asset Management
https://www.netassetmanagement.com
"Tor Inge Rislaa" <tor.inge.nospam@rislaa.no> wrote in message
news:ea_Rc.120$g%5.1656@news2.e.nsc.no...
> I have the query below, giving me the "calculatedprice" for one "
invoice_id
> ". I have inserted a new field in the invoice table where I want to update
> the "calculatedprice" for every "invoice_id" in the table. How is that
done?
>
> SELECT SUM((unitprice * (unit_qty /factor)) - ((unitprice * (unit_qty
> /factor)) * discount / 100)) AS calculatedprice
> FROM invoice
> WHERE invoice_id = 2025
>
> TIRislaa
>
>
>
>


Relevant Pages

  • Re: Inserting calculated values
    ... I have a little spelling error the calculated data is actually from another ... table invoice_units (to be inserted in the invoice table based on the ... > UPDATE invoice ... >> TIRislaa ...
    (microsoft.public.sqlserver.programming)
  • Re: Inserting calculated values
    ... FROM Invoice I ... > "Roji. ... P. Thomas" skrev i melding ... >> Net Asset Management ...
    (microsoft.public.sqlserver.programming)