Re: Rundungsproblem
Zitat:
mit: TRUNC(((nettopreis *1000) + (nettopreis* 1000/100 * CAST(:mwstsatz AS NUMERIC(15,2))) +0.5) ) as bruttopreis habe ich richtig gerundet das 1000 fache. bekomme ich das jetzt noch innerhalb des statements wieder durch 1000 geteilt in bruttopreis, oder geht das nicht ? |
Re: Rundungsproblem
Delphi-Quellcode:
<Ausdruck> := Trunc( <Ausdruck> * 10 ^<Stellen>) / 10 ^<Stellen>;
|
Re: Rundungsproblem
Zitat:
'select artikel_id,artikelpreis_id, bezeichnung, gilt_abmenge, nettopreis, TRUNC(((nettopreis *1000) + (nettopreis* 1000/100 * CAST(:mwstsatz AS NUMERIC(15,2))) +0.5) ) as bruttopreis from artikelpreise ............'); so hab ich jetzt in bruttopreis das richtig gerundete aber 1000 fache Eergebnis :-( |
Re: Rundungsproblem
Einfach nach dem Trunc durch 1000 teilen
|
Re: Rundungsproblem
Zitat:
wenn ich _nicht_ teile steht im currency-feld 8500000, also das tausendfache was ich brauche teile ich durch 10 steht im currency-feld 850000 teile ich durch 100 steht im currency-feld 80000 teile ich durch 1000 steht im currency-feld 0 was läuft da schief? :-( EDIT: sieht für mich so aus als würde das TRUNC erst nach den Rechenoperationen ausgeführt, oder? |
Re: Rundungsproblem
Zitat:
|
Re: Rundungsproblem
Zitat:
so: (TRUNC(((nettopreis *1000) + (nettopreis* 1000/100 * CAST(:mwstsatz AS NUMERIC(15,2))) +0.5) ))/1000 as bruttopreis funktionierts ja nicht :-( |
Re: Rundungsproblem
Und warum nicht?
|
Re: Rundungsproblem
Zitat:
|
Re: Rundungsproblem
Zitat:
im Moment mach ich das ja so: TColumn(self.Columns[3]).Field:= FpreiseQuery.FieldByName('bruttopreis'); |
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:30 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz