Results 1 to 4 of 4
  1. #1
    Farida is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    19

    Insert and Store Decimal values in a Access Table

    Hi,

    I have a form that has INSERT query on a button as below.
    The immediage window displays below result for my query which is ok.

    INSERT INTO PROJECTS_DATA([MOC NUMBER], [LOCATION NAME], [PROJECT_ENG], [LEAD_ENG], [SHUTDOWN_YEAR], [FRAMING_SESSION], [PLANNED_DATE], [PR_NO], [CONTRACT_NO], [ACTUAL], [PLANNED], [VARIANCE], [PROGRESS], [MOC_CLOSURE], [STATUS], [PLAN], [CONCERN]) VALUES ('CR14-00001','', '', '', '', 0, '', '', '', 45.8, 5.69, 40.11, '', 0, '', '','')

    I want to emphasize passing of the percentage values to the table (highlighted in red). In the table the data is stored as below.


    Click image for larger version. 

Name:	accesserror.jpg 
Views:	12 
Size:	36.1 KB 
ID:	22500

    Please advise, why my decimal value is getting truncated? Below is the field properties.

    Click image for larger version. 

Name:	accesserror1.jpg 
Views:	12 
Size:	83.3 KB 
ID:	22501

    Ideally, these are actually percentage values and it will be great is you can also advise me how i can pass & store these as percentage values.

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Apparently, using the Decimal type can be problematic (see: http://www.fmsinc.com/microsoftacces...type/index.htm).
    Try using Single or Double instead.

    I was able to re-create the exact same issue you reported, and when I changed it to Single/Double, it worked properly.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2013
    Join Date
    Nov 2009
    Posts
    2,392
    change format to Fixed, and scale to 2

  4. #4
    Farida is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2015
    Posts
    19
    Worked like a charm. Thanks JoeM.

    In the database i chnaged the field size to Single
    And in the form, i changed the textox format to Fixed.

    Thanks.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 1
    Last Post: 03-17-2014, 02:13 AM
  2. Insert Into Query With Table data and values
    By WickidWe in forum Queries
    Replies: 1
    Last Post: 01-05-2014, 06:41 PM
  3. Replies: 5
    Last Post: 11-17-2013, 04:20 PM
  4. Replies: 2
    Last Post: 02-04-2012, 01:48 PM
  5. How do I get dlookup values to store in table
    By rpmyhero in forum Access
    Replies: 1
    Last Post: 11-25-2009, 05:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums