Jim,

try:

UPDATE lycopy03 SET totalamt = ctotals FROM tmdinv T1, invsmrize T2 +
WHERE T1.category = T2.category

assuming cTotals only exists in one table. If not, put the alias back 
--   t2.ctotals, but not the parens.

Ben Petersen


On 8 Jun 2004 at 16:25, Jim Limburg wrote:

> Could someone fill me in on what I'm doing wrong here..
> 
> DROP VIEW invsmrize
> CREATE VIEW invsmrize (category, ctotals ) +
> AS SELECT category, SUM(cy_unit_cost * quantity) FROM tmdinv +
> GROUP BY category
> 
> UPDATE lycopy03 SET totalamt = (T2.ctotals) FROM tmdinv T1, invsmrize T2 +
> WHERE T1.category = T2.category
> 
> I am creating the view above to gather some totals, and then I just
> want to update a column in a table with the results. The lycopy03 table
> has just two columns Category (Text 15) and totalamt which is currency.
> The tmdinv table has several columns but the Category is Text 15, the
> cy_unit_cost is double and the quantity is real. In my view I get some
> ugly results, and I'm wondering if this is the culprit here.
> 
> Any help appreciated.
> 
> Jim Limburg
> 

Reply via email to