Unix Technical Forum

Question money datatype

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 ...


Go Back   Unix Technical Forum > Database Server Software > Microsoft SQL Server > SQL Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-28-2008, 07:31 PM
Fred Geurtsen
 
Posts: n/a
Default Question money datatype

Hi,

The result of my query is a money datatype, but it shows to 4 decimal places
> and I only want 2!!


Thx


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 07:31 PM
David Portas
 
Posts: n/a
Default Re: Question money datatype

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
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-28-2008, 07:31 PM
Fred Geurtsen
 
Posts: n/a
Default Re: Question money datatype

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
> >
> >

>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-28-2008, 07:31 PM
David Portas
 
Posts: n/a
Default Re: Question money datatype

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
>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-28-2008, 07:32 PM
Bas
 
Posts: n/a
Default Re: Question money datatype

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
> > >
> > >

> >
> >

>
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:37 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com