Results 1 to 7 of 7
  1. #1
    nightclock is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    2

    yes/no checklist query help

    i have a database on a checklist of videogames and i'm trying to run a query to show me how many games from each publisher i have but i'm having a problem, it'll only show each publisher once but it won't count any of the yes and no it just counts the total of how many times the publisher shows up in the row so instead of being

    5/10 Ubisoft
    8/13 EA
    2/5 Activision
    it'll return the results as
    10 Ubisoft
    13 EA
    5 Activision
    on top of this i have another question that i want to know if it's possible to expand/shrink in each publisher result so for example if it was correctly displaying the way i want it above it'd be like this


    5/10 ubisoft
    -yes prince of persia 1
    -yes prince of persia 2
    -no prince of persia 3
    -no assassin's creed 5
    -yes assassin's creed 6
    -no assassin's creed 7
    -no ghost recon 4
    -no ghost recon 5
    -yes ghost recon 6
    -yes ghost recon 7

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Please show us your table structure, and the SQL of your query. Your phrase

    counts the total of how many times the publisher shows up in the row
    is a red flag that your data may not be properly normalized.

    For your last question - a query can't expand a list as you would like - for that layout you would need a report or a form-subform arrangement.

  3. #3
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    want to know if it's possible to expand/shrink in each publisher result
    you would need to use the activeX treeview control used in a form, however it is not well documented.

    In a query, if you have two tables, publishers and games, and set the relationships correctly then in a new query with just publishers and the table source you can right click on the query gui (top bit) and select properties if not already displayed.

    In Subdatasheet name put the name of your games table then populate the Link Child Fields and Link Master Fields with the relevant primary and foreign keys. When you run the query, click on the + button to expand. Note this facility is not made available in forms

  4. #4
    nightclock is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    2
    Quote Originally Posted by John_G View Post
    Please show us your table structure, and the SQL of your query. Your phrase



    is a red flag that your data may not be properly normalized.

    For your last question - a query can't expand a list as you would like - for that layout you would need a report or a form-subform arrangement.
    i have no SQL running in the query i'm just running it through the duplicate query wizard and as for saying row i meant column

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Thanks, Ajax - I didn't know that (probably because I never had a need for it).

    There's always a lot to learn in this business.

  6. #6
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    it'll only show each publisher once but it won't count any of the yes and no it just counts the total of how many times the publisher shows up in the column
    To show how many games you have from each publisher, you need to add a criteria to your query to count only records where the checkbox field is True.

    If you really want to have both values (e.g. 5 and 10 for Ubisoft), then don't use the criteria. Instead, in your totals query, count the number of occurrences of the checkbox with Count() as you did before (I assume). That will give you the 10 part.

    Create another field with an expression something like this: IIf([checkbox],1,0), where [checkbox] is the name of the checkbox field, and SUM that expression. That will give you the 5 part.

    If you want to show the results as "5 / 10", create an expression like this:

    Sum(IIf([checkbox],1,0)) & " / " & Count([checkbox])

    and in the query, set the value in the Total row to "Expression" (select from the dropdown)

  7. #7
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,409
    i have no SQL running in the query i'm just running it through the duplicate query wizard and as for saying row i meant column
    The query window you are using is just a way of visualising the SQL. If you look to the top left of the ribbon you will see a view option - one of these is SQL - select it and you will see the SQL that the query window has generated. Showing the SQL code is the best way to get help on this and other forums with regards queries.

    I didn't know that
    has its uses when developing - find it quite useful to swap round - i.e. games table is the one in the query and publishers is the Subdatasheet so you can check who the owner is

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

Similar Threads

  1. checklist
    By slimjen in forum Forms
    Replies: 23
    Last Post: 06-20-2013, 11:17 AM
  2. Replies: 5
    Last Post: 11-02-2012, 02:31 PM
  3. Replies: 7
    Last Post: 07-09-2012, 09:20 PM
  4. Refreshing Daily Checklist
    By sved in forum Access
    Replies: 1
    Last Post: 06-24-2011, 04:13 PM
  5. Filling a table from a checklist
    By mr.wizzard in forum Access
    Replies: 3
    Last Post: 06-19-2010, 09:40 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