Results 1 to 3 of 3
  1. #1
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481

    Desired Numerical Format in Query!

    Hi

    Good Day

    I have query and the below formula for caculations:

    ResiduePernt: Nz([ResidueQty],0)/Nz([SampleQty],0)*100

    and got values 19.4300003051758

    How to format it up to two decimals places * 19.43

    Note: Its very easy to use the "FormatPercent" format but its creating problems later on for calculation in reports.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,645
    Using 0 as the Nz() alternate value in denominator can result in division by 0 error. Use 1 as the alternate.

    Setting format property does not change the actual value. Format and FormatNumber functions result in a text value so if that causes issue, might have to convert back to a number, like: CDbl(Format(x, "0.00")).

    Could use Round function. Be aware it uses even/odd (banker's rule) rounding.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    cap.zadi is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2011
    Location
    KSA
    Posts
    481
    Hi Mr. June

    Thanks for the usual feedback.

    You are right and i will do correct accordingly.

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

Similar Threads

  1. Replies: 2
    Last Post: 07-19-2018, 12:05 PM
  2. Replies: 3
    Last Post: 03-28-2018, 04:01 PM
  3. Query is eliminating duplicate records when not desired
    By AccessNovice16 in forum Queries
    Replies: 10
    Last Post: 05-30-2017, 08:45 AM
  4. Query not producing the desired data
    By WAVP375 in forum Access
    Replies: 7
    Last Post: 01-14-2016, 02:18 PM
  5. LIKE query does not give desired results
    By MarksinMO in forum Queries
    Replies: 3
    Last Post: 09-03-2015, 06:58 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