Results 1 to 2 of 2
  1. #1
    lwilt is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2013
    Posts
    7

    Converting text to 2 decimal places

    I'm trying to convert a text field to a numeric field with 2 decimal places but it won't work. Please Help



    I tried String:Format(CDec([Field],"0.00")

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    When you apply the FORMAT function, you are converting it back to a text/string value. So you are basically undoing what you are trying to do by using the CDEC function (you are going from Text to Decimal back to Text).

    If you want to convert a string to a number, I usually do it like this:
    CDbl([Field])

    If you want to change the display so that 2 decimals are shown (i.e. on a Form, Report, Query, etc), you would just change the Format property of that calculated field to show 2 decimals.

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

Similar Threads

  1. Formatting for 3 decimal places
    By Triland in forum Forms
    Replies: 12
    Last Post: 01-24-2013, 10:49 AM
  2. Decimal Places
    By momodoujimnjie in forum Access
    Replies: 1
    Last Post: 01-09-2013, 04:49 AM
  3. Report decimal places
    By jackyoung2012 in forum Reports
    Replies: 1
    Last Post: 03-22-2012, 12:12 PM
  4. Limiting decimal places
    By Cran29 in forum Access
    Replies: 13
    Last Post: 01-08-2011, 08:01 AM
  5. Changing decimal places
    By stupesek in forum Reports
    Replies: 12
    Last Post: 09-01-2010, 11:33 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