hi everyone,
i tried to get these two scripts together:
SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | withusrShowAuftragsbestandCTEas(selectBerechnungsDatumasDuedate,Netto,ZielgebietfromusrShowAuftragsbestandwhereWaehrung='CHF')selectDuedate,round(SUM(Netto),2)asNettoSumme,ZielgebietfromusrShowAuftragsbestandCTEWHEREDATEDIFF(DAY,Duedate,GETDATE())<14groupbyDuedate,ZielgebietorderbyDuedatedesc,Zielgebiet |
SQL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | withusrShowAuftragsbestandCTEas(selectBerechnungsDatumasDuedate,NettofromusrShowAuftragsbestandwhereWaehrung='CHF'andLieferterminisnull)selectDuedate,round(SUM(Netto),2)asNettoSummefromusrShowAuftragsbestandCTEWHEREDATEDIFF(DAY,Duedate,GETDATE())<14groupbyDuedateorderbyDuedatedesc |
i'm not very good in SQL - so any advice is welcome :)
thanks and regards