Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

An aggregate may not appear in the set list of an UPDATE statement.

$
0
0

Hi,

I receive the above error message if i run this query

UPDATE   EDW.Planning.TEDW_F_TRANSACTION_CHANNEL_OPS_GOAL 
SETOPS_GOAL = SUM(TEDW_F_STORE_OPS_GOAL.OPS_GOAL)
FROM   EDW.Planning.TEDW_F_STORE_OPS_GOAL
INNER JOIN
              EDW.Calendar.TEDW_D_DATE_TYPE_1
ON            TEDW_D_DATE_TYPE_1.DATE_KEY                     = TEDW_F_STORE_OPS_GOAL.DATE_KEY
cross join
              EDW.Utility.TEDW_J_PROCESS_DATE 
              
WHERE TEDW_D_DATE_TYPE_1.FISCAL_YEAR_ID= (
select Distinct FISCAL_YEAR_ID 
fromEDW.Calendar.TEDW_D_DATE_TYPE_1
left outer joinEDW.Staging.TEDW_S_JJSTOREOPSGOALS  
ONTEDW_D_DATE_TYPE_1.DATE_SHORT=TEDW_S_JJSTOREOPSGOALS.DATE
whereTEDW_S_JJSTOREOPSGOALS .DATE is not null )
ANDTEDW_F_TRANSACTION_CHANNEL_OPS_GOAL.DATE_KEY=TEDW_D_DATE_TYPE_1.DATE_KEY
ANDTEDW_F_TRANSACTION_CHANNEL_OPS_GOAL.TRANSACTION_CHANNEL_KEY=   TEDW_F_STORE_OPS_GOAL.TRANSACTION_CHANNEL_KEY

Can someone please help me with this?

Thanks


Viewing all articles
Browse latest Browse all 23857

Trending Articles