Results 1 to 8 of 8
  1. #1
    KMac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    6

    Report Expression Building

    I have a very simple report that pulls in data from the results of a query. There are five fields brought over. One is titled Position Rating and there are 4 values that may be choosen for that field in the original table. I have a ratings table with the following grades Excellent, Good, Fair and Poor. The location table links the Position Rating field to the Ratings table.



    I tried to write a expression that would total each. Here is a varaitaion of what I have been trying =Count([Position Rating]=[Good]). I have tried quotation marks, ID values for the ratings moving things around and I can't get a count on each value.

    I am relativly new to Access. I am able to get a count of all values so I am fairly sure I am close.

    Thanks for any support you can give me.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Try

    =Sum(IIf([Position Rating]="Good", 1, 0))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    KMac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    6

    Thank You

    It worked perfectly. In fact, after you provided this I was able to expand the expression to multiply and divide the results to get an overall percentage.

    Thanks Again!!!!

  4. #4
    KMac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    6
    OK, new question: I have a query and the report (mentioned above) runs based on the results of the query. Everything works great now after the help provided above.

    But, now I copy the query and the report. I set the Record Source for the report to the Copy of Query and when I open the report it asks twice for Parameters. I can not figure out why. I amke no chanes to either the copied report or query except pointing the copies report to the copies query.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    If you open the query copy does it prompt? Somewhere must be a reference that includes the query name, so let's figure out whether it's in the query or report.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    KMac is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2012
    Posts
    6
    Nope, no prompt when I open or execute the query. But, as soon as I open the rport I get two parameter prompts on fields that are not included anywhere in the query or the report

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Sometime they hide in Sorting and Grouping. If not, can you post the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    RayMilhon is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,085
    Sometimes Access is sneaky that way.

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

Similar Threads

  1. Replies: 2
    Last Post: 11-20-2012, 03:21 AM
  2. Report - Expression Builder
    By AndreasPanayiotou in forum Reports
    Replies: 3
    Last Post: 09-16-2012, 01:10 AM
  3. Replies: 5
    Last Post: 03-13-2012, 11:53 AM
  4. Calculated expression in report
    By Grizz2 in forum Reports
    Replies: 3
    Last Post: 12-20-2010, 08:50 PM
  5. Building a Difficult DateDiff Expression
    By jma108 in forum Queries
    Replies: 0
    Last Post: 06-15-2009, 12:39 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