Results 1 to 6 of 6

Thread: [RESOLVED] MS Access 97 Database Decimal Problem

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    Resolved [RESOLVED] MS Access 97 Database Decimal Problem

    Hi

    Ive created a DB for VB6

    Now a field cost has the following

    field size : long integer
    format : general integer
    decimal places : 2

    Now whatever value is being put there.. its getting rounded off..

    I want it to be stored as 2 decimal places..

    So eg : I want the field to store number as 33.67 OR 99.01 .. or 99.00

    But it is rounding it off..

    can anyone tell me why is it rounding off and how to fix the field on any input to 2 decimal places..
    Last edited by khandu; Feb 3rd, 2007 at 07:46 AM.

  2. #2
    Member
    Join Date
    Apr 2003
    Posts
    37

    Re: MS Access 97 Database Decimal Problem

    There is no problem aside from operator error; Its an integer field, look it up, then use single.
    Last edited by default user; Feb 3rd, 2007 at 08:30 AM.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    Re: MS Access 97 Database Decimal Problem

    thanks .. rep added and thread resolved

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    Re: [RESOLVED] MS Access 97 Database Decimal Problem

    oops sorry not resolved..

    i am doing some calculations and saving in the field "cost"

    still saving as 87.65002

    Field Properties
    datatype : number
    field size : single
    decimal places : 2

    please help here

  5. #5
    Member
    Join Date
    Apr 2003
    Posts
    37

    Re: MS Access 97 Database Decimal Problem

    Try trimming the value before saving.

    val = int(Val * 100)/100

    I suspect the format you are setting is for the Access user interface -input only.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Dec 2006
    Posts
    139

    Re: MS Access 97 Database Decimal Problem

    yeah that trim did the works..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width