Results 1 to 5 of 5
  1. #1
    akika is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    21

    display % in query


    Hi
    How to format the values to add % in the select for below line:

    Round(IIf([status]=0,0, ([status]/[total_count]*100))) AS Perc_status


    to display 57% instead of 57 only.

    Thxs

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,583
    Try using

    Format([YourField],"Percent")

    You might need to remove the *100
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    akika is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    21
    yeah need to remove the * 100

    How can i round the values obtained for Format([YourField],"Percent")

    getting like 57.21% need to round it off to 57%

  4. #4
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    1,583
    Use

    Format([YourField],"##%")

    Instead.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  5. #5
    Ajax is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    8,901
    be aware the format function changes the value from numeric to text. This may not matter if the value is not going to be used for further calculations. If it is, use the format property instead. Also, better to leave data as is until final presentation - so if your query is being exported, all well and good. But if appearing in a form or report, recommend you do your formatting there instead.

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

Similar Threads

  1. Replies: 3
    Last Post: 10-28-2015, 12:38 PM
  2. Display Query
    By jamesfranklin in forum Queries
    Replies: 5
    Last Post: 02-24-2013, 11:26 PM
  3. Replies: 8
    Last Post: 10-22-2012, 07:43 PM
  4. VBA code to display value from SQL query
    By agent- in forum Programming
    Replies: 9
    Last Post: 05-05-2011, 03:52 PM
  5. Display Query Name
    By jgelpi16 in forum Programming
    Replies: 7
    Last Post: 07-20-2010, 08:46 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 - Senior Forums