Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
mana
Posting Yak Master
102 Posts |
Posted - 2014-09-05 : 05:39:19
|
i have the below query but it has error can you help me please?update dbo.Bewegungen_Inventur_Korrekturenset SumOfMenge= select SUM(Menge) from dbo.Bewegungen_Inventur_Korrekturengroup by Workcenter,Reason_Code,Datum_Bewegung,Teil_Nummer; |
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2014-09-05 : 05:54:38
|
[code]UPDATE fSET SumOfMenge = sFROM ( SELECT SumofMenge, SUM(Menge) OVER (PARTITION BY Workcenter, Reason_Code, Datum_Bewegung, Teil_Nummer) AS s FROM dbo.Bewegungen_Inventur_Korrekturen ) AS f;[/code] Microsoft SQL Server MVP, MCT, MCSE, MCSA, MCP, MCITP, MCTS, MCDBA |
|
|
mana
Posting Yak Master
102 Posts |
Posted - 2014-09-05 : 07:58:28
|
thank you for the answeri have a problemi want to calculate the wert as menge from dbo inventur * preis from view-lieferanten-preiscan you help me please? i dont' know how to write this?here are the tables::Bewegungen_Inventur_KorrekturenDatum_Bewegung datetime UncheckedTeil_Nummer varchar(20) UncheckedWorkcenter varchar(6) UncheckedReason_Code varchar(3) UncheckedId_Nr int UncheckedMenge numeric(11, 3) CheckedMengeneinheit varchar(2) CheckedDokumenten_Nummer varchar(8) CheckedZeit_Bewegung time(0) CheckedSumOfMenge numeric(18, 3) CheckedAnz_Adjustments numeric(18, 0) Checked Unchecked v_Lieferanten_PreiseTeil_Nummer Lieferanten_Nummer Lieferanten_Typ Liefer_Quote Preiseinheit Währungseinheit Preis Datum_gültig_Von Datum_gültig_Bis Datum_Eingabe Datum_Änderung Preis_Typ Modif_User Modif_Datum Modif_Status000079041845 GQ067 1 0 EA EUR 19137.583 2012-07-16 00:00:00.000 9999-12-31 00:00:00.000 2012-07-16 00:00:00.000 2012-07-19 00:00:00.000 dbo 2014-09-04 21:32:37.537 1quote: Originally posted by mana i have the below query but it has error can you help me please?update dbo.Bewegungen_Inventur_Korrekturenset SumOfMenge= select SUM(Menge) from dbo.Bewegungen_Inventur_Korrekturengroup by Workcenter,Reason_Code,Datum_Bewegung,Teil_Nummer;
|
|
|
mana
Posting Yak Master
102 Posts |
Posted - 2014-09-05 : 08:00:45
|
wert is a column in dbo.Bewegungen_Inventur_Korrekturenquote: Originally posted by mana thank you for the answeri have a problemi want to calculate the wert as menge from dbo inventur * preis from view-lieferanten-preiscan you help me please? i dont' know how to write this?here are the tables::Bewegungen_Inventur_KorrekturenDatum_Bewegung datetime UncheckedTeil_Nummer varchar(20) UncheckedWorkcenter varchar(6) UncheckedReason_Code varchar(3) UncheckedId_Nr int UncheckedMenge numeric(11, 3) CheckedMengeneinheit varchar(2) CheckedDokumenten_Nummer varchar(8) CheckedZeit_Bewegung time(0) CheckedSumOfMenge numeric(18, 3) CheckedAnz_Adjustments numeric(18, 0) Checked Unchecked v_Lieferanten_PreiseTeil_Nummer Lieferanten_Nummer Lieferanten_Typ Liefer_Quote Preiseinheit Währungseinheit Preis Datum_gültig_Von Datum_gültig_Bis Datum_Eingabe Datum_Änderung Preis_Typ Modif_User Modif_Datum Modif_Status000079041845 GQ067 1 0 EA EUR 19137.583 2012-07-16 00:00:00.000 9999-12-31 00:00:00.000 2012-07-16 00:00:00.000 2012-07-19 00:00:00.000 dbo 2014-09-04 21:32:37.537 1quote: Originally posted by mana i have the below query but it has error can you help me please?update dbo.Bewegungen_Inventur_Korrekturenset SumOfMenge= select SUM(Menge) from dbo.Bewegungen_Inventur_Korrekturengroup by Workcenter,Reason_Code,Datum_Bewegung,Teil_Nummer;
|
|
|
|
|
|
|
|