Hey Guys,
I'm trying to update table A with the sum of a column in table B. But the sum is by product number, not the bottom line sum.
Here's what I have but the compute part isn't working for the update. The select statement works good without the update part.
It's proably not to hard but I'm still winging it.
I'm trying to update table A with the sum of a column in table B. But the sum is by product number, not the bottom line sum.
Here's what I have but the compute part isn't working for the update. The select statement works good without the update part.
Code:
update [SFR Testing for MMR].dbo.[Tmp Transfer Table]
set [Pre-Month Sales Cnt] = (select [Short Sku], Produit, [Qté facturée]
from [TSC05].[OMNIF_A].dbo.[Fact ventes détail] iv inner join [SFR Testing for MMR].dbo.[Tmp Transfer Table] tt
on iv.Produit = (substring(tt.[Short Sku],2,6)+right((tt.[Short Sku]),1))
where [Date comptable] = '2005/02/17' and
Produit = '2167604'
order by Produit
compute sum([Qté facturée]) by Produit)
It's proably not to hard but I'm still winging it.