Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Re: this decimal rounding & losing last digit


Message #1 by dont worry <aspmailbox@y...> on Wed, 3 Apr 2002 12:33:32 -0800 (PST)
This INSERT works, BUT

cmd.Parameters.Append cmd.CreateParameter("Param4",
adDecimal, adParamInput)

  cmd("Param4") = CDBL(class_duration)
  cmd("Param4").Precision = 4
  cmd("Param4").NumericScale = 2

*In SQL server the number rounds up and the two digits
after the decimal are .00.
any hints?



--- dont worry <aspmailbox@y...> wrote:
> When inserting decimals in to Sql server database
> datatype decimal percision 18, scale 2.  It will
> round
> my number up or it removes the last digit if it is a
> zero.  How do I avoid both of these things?
> 
> cmd.Parameters.Append cmd.CreateParameter("Param4",
> adInteger, adParamInput)
> cmd("Param4") = 23.53
> 
> 
> i've tried changing the CreateParameter to
> adDecimal,
> but it gives an percision is incorrect error.
> thanks
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Tax Center - online filing with TurboTax
> http://http://taxes.yahoo.com/
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/
Message #2 by dont worry <aspmailbox@y...> on Tue, 2 Apr 2002 11:50:57 -0800 (PST)
When inserting decimals in to Sql server database
datatype decimal percision 18, scale 2.  It will round
my number up or it removes the last digit if it is a
zero.  How do I avoid both of these things?

cmd.Parameters.Append cmd.CreateParameter("Param4",
adInteger, adParamInput)
cmd("Param4") = 23.53


i've tried changing the CreateParameter to adDecimal,
but it gives an percision is incorrect error.
thanks


__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

  Return to Index