Results 1 to 3 of 3
  1. #1
    dascoli is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Posts
    16

    Display Unique Zip Codes From Query in Report

    I have a query that displays unique clients based on a specified date range. I built a report based on this query to count how may of these unique clients are employed or unemployed and placed these counts in the report header.

    I want to be able to display unique zip codes for these clients that we had contact with either in the form header or detail. When I place the zip code field in the header it only displays the first client's zip code. When I place it in the detail section, the report displays all the field values (non-unique). I tried to make another query to base a subreport on that displays only unique zip codes, but even when I only include the zip code field and the contact date field it finds unique clients, not zip codes.

    I am at a loss for how to accomplish this. Any help is greatly appreciated!



    UPDATE:
    I got another query to return unique zip codes by running the second query based on the first query. I still cannot get these results to display properly on the report though.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    I'm not sure what you are really asking. If you want clients (plural) they may reside in the same or different zip codes.
    If you only want to show 1 client per zip code, which client would that be if there were 6 clients in that zip code?

    Perhaps you could provide an example of input and desired output.

    To get unique clients

    Code:
    SELECT DISTINCT ClientID FROM tblClient;

  3. #3
    dascoli is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Posts
    16
    The idea is to only show the zip codes. I think I managed to get it working by using a subreport that is based on the second query I created and not have it linked to the primary report. I have to do a little more testing though to make sure this worked.

    The report looks like this though:

    Total Clients-4
    Employed Clients-1
    Unemployed Clients-3

    Zip Codes Served-00001,00002,00003,00004

    Or

    Zip Codes Served:
    00001
    00002
    00003

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

Similar Threads

  1. Replies: 3
    Last Post: 03-11-2013, 05:11 PM
  2. Replies: 7
    Last Post: 03-10-2013, 11:29 AM
  3. Replies: 6
    Last Post: 10-30-2012, 11:36 AM
  4. Display Value of another QUERY into a Report
    By taimysho0 in forum Reports
    Replies: 2
    Last Post: 01-09-2012, 08:31 PM
  5. basic query codes
    By joms222 in forum Queries
    Replies: 1
    Last Post: 03-20-2009, 11: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