Results 1 to 3 of 3
  1. #1
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409

    total query returning values 0 too

    hi, i have this query



    Code:
    SELECT IscrittiOCF.REGIONE, Count(IscrittiOCF.DENOMINAZIONE_SOGGETTO_ABILITATO) AS ConteggioDiDENOMINAZIONE_SOGGETTO_ABILITATOFROM IscrittiOCF
    WHERE (((IscrittiOCF.DENOMINAZIONE_SOGGETTO_ABILITATO)=[Maschere]![OcfAnalisi].[form].[BancaAttualeCB])) OR ((([Maschere]![OcfAnalisi].[form].[BancaAttualeCB]) Is Null))
    GROUP BY IscrittiOCF.REGIONE;
    as you can see, it counts the guys that works in a specific bank ( IscrittiOCF.DENOMINAZIONE_SOGGETTO_ABILITATO) grouping by regions (IscrittiOCF.REGIONE).

    since very often there are region with no people, i get only the regions with people in it; is there any way to show the regions too withouth guys showing "0" as result?

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    You want an OUTER join. Dbl-click the join line in your query,
    Pick SHOW ALL Regions ,and some from the other table.
    Bring down the tRegions.name field,and the tClient.name

    You will see null for the missing clients not in region.
    Convert null to zero with NZ function.

  3. #3
    diegomarino is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    409
    i have no join line, my query is based on 1 table

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

Similar Threads

  1. Query returning all values instead of specified string
    By School Boy Error in forum Queries
    Replies: 19
    Last Post: 10-21-2017, 07:51 AM
  2. Replies: 5
    Last Post: 07-10-2015, 08:30 AM
  3. Replies: 2
    Last Post: 03-05-2015, 04:03 PM
  4. Query not returning all values
    By whitelexi in forum Queries
    Replies: 12
    Last Post: 09-06-2014, 11:40 PM
  5. Query not returning null values
    By janelgirl in forum Access
    Replies: 5
    Last Post: 10-11-2011, 10:31 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