Results 1 to 4 of 4
  1. #1
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43

    Where condition in report text box

    I have created a database for my sports team. I have a field called [Win/Loss] that shows a win or loss for the team. I realize I should have created two separate columns for this, but I am looking for a solution before having to do this. In my report, I have a grouping on [Win/Loss] to sort each game. What I would like to do is count the number of wins/losses for the year. Right now, it merely counts all of the records without specifying wins/losses. Is there a way to add a WHERE statement in the control source for my text box in order to count wins and then another for losses? Something like ... Where [Win/Loss] = 'Win' ?

  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,643
    Try

    =Sum(IIf([Win/Loss] = 'Win', 1, 0))
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    kazaccess is offline Advanced Beginner
    Windows 7 64bit Access 2013
    Join Date
    Jul 2013
    Posts
    43
    Perfect. Thanks so much!

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,643
    Happy to help!
    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. If Statement Condition - Opening Report
    By geraldk in forum Reports
    Replies: 3
    Last Post: 07-10-2013, 10:26 AM
  2. Report and IF Condition
    By ismailkhannasar in forum Queries
    Replies: 1
    Last Post: 01-31-2013, 04:29 AM
  3. Hide field in sub-report based on condition
    By vinsavant in forum Reports
    Replies: 4
    Last Post: 12-16-2012, 10:18 AM
  4. Replies: 1
    Last Post: 12-14-2010, 10:03 PM
  5. Open a report with a date condition
    By Grooz13 in forum Reports
    Replies: 3
    Last Post: 08-02-2010, 02:35 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