Results 1 to 3 of 3
  1. #1
    Madchemist is offline Novice
    Windows XP Access 2007
    Join Date
    Aug 2011
    Posts
    1

    Red face Minimizing number length in queries

    I have a table with temperature readings over a 12 hour time period. I have to find the average temperature over that time period. I built a query for a specific time period that listed all of the temperatures. I then queried that query to get the average temperature. It works great but there are at least 10 numbers to the right of the decimal place that I don't need. I can't figure out how to minimize the quantity of numbers that are displayed. I tried adjusting the size in the original table but have had no luck. Any suggestions?

  2. #2
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    You can try this:

    Code:
     
    Dim YourNumberBefore, YourNumberAfter as Double
    YourNumber = 96.12398473283
     
    YourNumberAfter = Format (YourNumberBefore, "#,##0.00") 'Should return '96.12'

  3. #3
    Robeen is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Mar 2011
    Location
    Tulsa, Oklahoma.
    Posts
    1,596
    Sorry, you need that to run in your query.

    In query design, add your Temperature field and then do this where the field is added:

    FormattedTemp: Format([Temperature], "#,##0.00")

    I think that will give you your two [if that's what you need] decimal places.

    OR - again in query design mode, click in your Temperature field, open the Properties for that field, select the type of data that you need the Temperature field to be - and then change the Decimal Places value to whatever you need it to be.

    I hope this helps!

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

Similar Threads

  1. Number format in queries
    By bullwinkle55423 in forum Queries
    Replies: 1
    Last Post: 08-16-2011, 06:55 PM
  2. Length of Stay
    By lhysell in forum Queries
    Replies: 1
    Last Post: 02-02-2011, 10:45 AM
  3. Sort according to field length?
    By wawinc in forum Queries
    Replies: 4
    Last Post: 12-15-2010, 04:27 PM
  4. Convert number to fixed length text field
    By tpcervelo in forum Queries
    Replies: 1
    Last Post: 08-02-2010, 07:26 PM
  5. Minimizing combo dropdown on click
    By DanW in forum Forms
    Replies: 2
    Last Post: 11-18-2009, 03:33 PM

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