Suggest a feature
×

Welcome to TagMyCode

Please login or create account to add a snippet.
0
0
 
0
Language: T-SQL
Posted by: Sascha Manns
Added: Apr 17, 2019 2:31 PM
Modified: Apr 23, 2019 6:44 AM
Views: 15
Tags: no tags
  1. select sum(cast(replace(Reparaturkosten, ',', '.') as decimal(18,2))) as Reparaturkosten, -- Wichtig: 18,2 bei normalen Operationen
  2. sum(cast(replace(Reparaturkosten, ',', '.') as decimal(18,0)))*1.19 as ReparaturkostenBrutto, -- Wichtig: 18,0 bei Berechnungen
  3. sum(cast(replace(Reparaturkosten, ',', '.') as decimal(18,0)))*0.19 as ReparaturkostenMwST, -- Produziert sonst 4 Nachkommastellen
  4. sum(cast(replace(Minderwert, ',', '.') as decimal(18,2))) as Minderwert,
  5. sum(cast(replace(Minderwert, ',', '.') as decimal(18,0)))*1.19 as MinderwertBrutto,
  6. sum(cast(replace(Minderwert, ',', '.') as decimal(18,0)))*0.19 as MinderwertMwST,
  7. (sum(cast(replace(Minderwert, ',', '.') as decimal(18,2)))+sum(cast(replace(Reparaturkosten, ',', '.') as decimal(18,2)))) as Gesamt,
  8. (sum(cast(replace(Minderwert, ',', '.') as decimal(18,0)))+sum(cast(replace(Reparaturkosten, ',', '.') as decimal(18,0))))*1.19 as GesamtBrutto,
  9. (sum(cast(replace(Minderwert, ',', '.') as decimal(18,0)))+sum(cast(replace(Reparaturkosten, ',', '.') as decimal(18,0))))*0.19 as GesamtMWsT
  10. from BewertungFoto
  11. where WENumber = '{state:vin}'