Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.ms-sqlserver > #1330

SSE2008 money Type

From Gene Wirchenko <genew@ocis.net>
Newsgroups comp.databases.ms-sqlserver, microsoft.public.sqlserver.programming
Subject SSE2008 money Type
Date 2012-10-10 19:47 -0700
Organization A noiseless patient Spider
Message-ID <mqcc78906k2avdq0uuj25nem4r5b4qnsnp@4ax.com> (permalink)

Cross-posted to 2 groups.

Show all headers | View raw


Dear SQLers:

     According to Microsoft
 http://msdn.microsoft.com/en-us/library/aa258271%28v=sql.80%29.aspx
money has four decimal digits.  Unfortunately, if I use print to check
things, I sometimes do not get the four digits displayed as in:

print 12.345;     -- prints 12.345
print convert(money,12.345);     -- prints 12.35
print 12.35-convert(money,12.345);     -- prints 0.0050
print convert(money,12.35)-convert(money,12.345);     -- prints 0.01
print 12.345+convert(money,12.345)-12.345;     -- prints 12.3450

     The precision is apparently there per the third statement, but
how do I force it?  I have tried variations with the second statement,
but I have been unable to get it to output 12.345.  How is it that the
third statement gives four decimal digits, but the second and fourth
do not?  The fifth statement is just plain weird.

     I have no trouble with selects.

     What am I missing, please?

Sincerely,

Gene Wirchenko

Back to comp.databases.ms-sqlserver | Previous | NextNext in thread | Find similar


Thread

SSE2008 money Type Gene Wirchenko <genew@ocis.net> - 2012-10-10 19:47 -0700
  Re: SSE2008 money Type "Bob Barrows" <reb01501@NOSPAMyahoo.com> - 2012-10-11 06:40 -0400
    Re: SSE2008 money Type rja.carnegie@gmail.com - 2012-10-11 04:45 -0700
      Re: SSE2008 money Type "Bob Barrows" <reb01501@NOyahooSPAM.com> - 2012-10-11 12:53 -0400
  Re: SSE2008 money Type Erland Sommarskog <esquel@sommarskog.se> - 2012-10-11 11:16 +0000

csiph-web