Value Rounds Up

Aug 21, 2007

dim ierr_amt as decimal
 
 mytxtErr_Amt = CType(item.FindControl("txtERR_AMT"), TextBox)
                                    ierr_amt = mytxtErr_Amt.Text     'this point ierr_amt is 8534.88
                                   
                                   
                                    insert statement
                                    ByVal ierr_amt As Decimal
                                   
                                    aParms(3) = New SqlParameter("@ierr_amt", SqlDbType.Decimal)
                                       
                                        If ierr_amt = Nothing Then
                                            aParms(3).Value = DBNull.Value
                                        Else
                                            aParms(3).Value = ierr_amt  'this point also 8534.88
                                                  end if
                                                 
                                                 
                                                  When I go check database it is value is rounded up and saved that way 8435
                                                 
err_amt column in database takes money (10,2)

View 4 Replies


ADVERTISEMENT

SQL Insert Rounds Decimal

Sep 25, 2006

Everytime i try to insert into my database it rounds all my decimals to ints.  In design view they are decimals.  Here is the code:cmd.Parameters.Add("@B_NetProceeds", SqlDbType.Decimal).Value = B_Proceeds;In Database i get 859Label1.Text = B_Proceeds.ToString() gives me 858.67 Why does it keep rounding?  Also my float works fine.  Its just the decimal.

View 7 Replies View Related

Percent Field Rounds To Whole Number

Apr 18, 2005

I am having a problem retaining the right 2 decimal places in my datagrid field. I have it defined as a decimal but when the update happens it rounds the decimal places back to .00.
Dim NewMarkup As String
'retrieve the new values
NewMarkup = CType(e.Item.FindControl("Markup"), TextBox).Text
'create the ado.net objects
Dim command As New SqlCommand("UpdatePricing", connection)
command.CommandType = CommandType.StoredProcedure
'parameters
command.Parameters.Add("@Markup", SqlDbType.Decimal, 5)
command.Parameters("@Markup").Value = CDec(NewMarkup)
Thanks!

View 2 Replies View Related

Sql Views - Embedded View Work-a-rounds

Jul 11, 2007

hi guys,

i've been asked to re-write a sql view. the view itself contains several calls to other views (embedded). is there a way to get around using embedded views. I've written the same query up using temp. tables but obviously temp. tables can't be used in views?

Is there any special things I should be looking for?

View 2 Replies View Related

SQL Views - Embedded View Work-a-rounds

Jul 12, 2007

Hi guys,I've been asked to re-write a sql view. The view itself containsseveral calls to other views (embedded). Is there a way to get aroundusing embedded views. I've written the same query up using temp.tables but obviously temp. tables can't be used in views?Is there any special things I should be looking for?

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved