This is a discussion on Question money datatype within the SQL Server forums, part of the Microsoft SQL Server category; --> Hi, The result of my query is a money datatype, but it shows to 4 decimal places > and ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| |||
| So use DECIMAL/NUMERIC(x,2) instead. MONEY and SMALLMONEY are fixed at 4 decimals. -- David Portas ------------ Please reply only to the newsgroup -- "Fred Geurtsen" <f.geurtsen@simstones.nl> wrote in message news:f1xmb.16786$n03.1257724@zonnet-reader-1... > Hi, > > The result of my query is a money datatype, but it shows to 4 decimal places > > and I only want 2!! > > Thx > > |
| |||
| It's a big application and it's a lot of work to change this! Is it possible to put this in my query statement? thx "David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message news:PKmdncXh1LvnPAeiRVn-iQ@giganews.com... > So use DECIMAL/NUMERIC(x,2) instead. MONEY and SMALLMONEY are fixed at 4 > decimals. > > -- > David Portas > ------------ > Please reply only to the newsgroup > -- > > "Fred Geurtsen" <f.geurtsen@simstones.nl> wrote in message > news:f1xmb.16786$n03.1257724@zonnet-reader-1... > > Hi, > > > > The result of my query is a money datatype, but it shows to 4 decimal > places > > > and I only want 2!! > > > > Thx > > > > > > |
| |||
| SELECT CAST(x AS NUMERIC(17,2)) -- David Portas ------------ Please reply only to the newsgroup -- "Fred Geurtsen" <f.geurtsen@simstones.nl> wrote in message news:f1xmb.16786$n03.1257724@zonnet-reader-1... > Hi, > > The result of my query is a money datatype, but it shows to 4 decimal places > > and I only want 2!! > > Thx > > |
| ||||
| I think formatting (number of decimals, decimal places, leading zeroes, etc.) should be done in the application. Maybe someday your users will want to show 3 decimals for stuff sold on invoices (mine did). Cheers, Bas "Fred Geurtsen" <f.geurtsen@simstones.nl> wrote in message news:fxxmb.16911$n03.1261243@zonnet-reader-1... > It's a big application and it's a lot of work to change this! > Is it possible to put this in my query statement? > thx > > "David Portas" <REMOVE_BEFORE_REPLYING_dportas@acm.org> wrote in message > news:PKmdncXh1LvnPAeiRVn-iQ@giganews.com... > > So use DECIMAL/NUMERIC(x,2) instead. MONEY and SMALLMONEY are fixed at 4 > > decimals. > > > > -- > > David Portas > > ------------ > > Please reply only to the newsgroup > > -- > > > > "Fred Geurtsen" <f.geurtsen@simstones.nl> wrote in message > > news:f1xmb.16786$n03.1257724@zonnet-reader-1... > > > Hi, > > > > > > The result of my query is a money datatype, but it shows to 4 decimal > > places > > > > and I only want 2!! > > > > > > Thx > > > > > > > > > > > > |