Results 1 to 10 of 10
  1. #1
    Join Date
    Mar 2011
    Location
    Lake Tahoe, CA
    Posts
    10

    Reduce field size in query field


    I created a new field in a QUERY in order to get an average:

    FIELD: Average Root Depth: ([T1-Rooting Depth (RD)]+[T2-RD]+[T3-RD])/3

    In datasheet view the number goes out to 13 decimal places.

    Any way to reduce it to 2 decimal places as you can in a table?? Thanks!!

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    My first thought is "who cares?", since I never let users view a query directly. In any case, you can wrap your calculation in the Round() function if you want.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Join Date
    Mar 2011
    Location
    Lake Tahoe, CA
    Posts
    10
    Thanks pbaldy, but I would like the values to appear manageable- 2 decimal places. I suppose if there isn't a quick fix function I can deal with the 13 decimals...

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    Did you try the Round() function I mentioned?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Join Date
    Mar 2011
    Location
    Lake Tahoe, CA
    Posts
    10
    Yes, the rounding worked but isn't precise enough for what I am doing. I would like 2 decimal places rather than a whole number.

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    The Round() function has an argument for how many decimal places to round to.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    escapades_access is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Lake Tahoe, CA
    Posts
    10
    Round(expression, [#decimal places])

    So I tried

    Average Root Depth: Round((([T1-Rooting Depth (RD)]+[T2-RD]+[T3-RD])/3),[2])

    Average Root Depth: Round(Avg([T1-Rooting Depth (RD)]+[T2-RD]+[T3-RD]),[2])

    both to no avail. Thanks for the idea. Wish I was having more success!

  8. #8
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    The brackets indicate the argument is optional; you don't want them in your formula. Try

    AverageRootDepth: Round((([T1-Rooting Depth (RD)]+[T2-RD]+[T3-RD])/3), 2)
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    escapades_access is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Mar 2011
    Location
    Lake Tahoe, CA
    Posts
    10
    Thanks pbaldy, it worked! Seriously, thanks for your help.

  10. #10
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,641
    No problemo! Just noticed you're right over the hill from me. I used to live in Tahoe, moved to Reno for work years ago.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Reduce PDF File Size
    By Phil Knapton in forum Programming
    Replies: 11
    Last Post: 02-16-2011, 09:10 AM
  2. Replies: 4
    Last Post: 07-28-2010, 10:27 AM
  3. Field size
    By nikki in forum Database Design
    Replies: 1
    Last Post: 02-15-2010, 09:19 AM
  4. Automatically Reduce Field Size
    By Rebecca in forum Access
    Replies: 4
    Last Post: 01-06-2010, 10:14 PM
  5. Compact/Reapir doe not reduce database size
    By nosrepmodnar in forum Access
    Replies: 1
    Last Post: 10-23-2009, 02:38 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