Results 1 to 10 of 10
  1. #1
    msouriya is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2020
    Posts
    11

    Query Duplicate fields, but want to show each once

    Ok, so I have two tables that I've joined together to create a query. My query is such that it has student names in table 1 and table 2 has services. I want to query out each a student's name once even though they more than one services. I just want to know if the students received services at all, so that's I just want each student's name to show up, but I'm getting duplicate of student's names. Below is my design. I hope that makes sense, please help 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,521
    Click on the Totals icon, change the services field to Count from Group By and see what that gives you. Your design didn't come through by the way.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    msouriya is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2020
    Posts
    11
    It didn't work. :-( Below is my design.

    Click image for larger version. 

Name:	Query Design.jpg 
Views:	22 
Size:	68.8 KB 
ID:	43577

  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,521
    Well, you've asked for a bunch of information from the services table, so you're going to get it. If all you want is to know that there were services, do what I described but drop all the fields from the services table but the first 2. Change the grouping row to Where on the date field and Count on the Service field.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    msouriya is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2020
    Posts
    11
    Good evening, thank you for your help. However that won't work either. I prompted that there was conflict. Please see image below:
    Attached Thumbnails Attached Thumbnails ConflictPrompt.jpg  

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you post the SQL of the query?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    msouriya is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2020
    Posts
    11
    SELECT DISTINCT StudentTBL.TSID, StudentTBL.StudentIDNumber, StudentTBL.LastName, StudentTBL.FirstName, StudentTBL.Grade2021, StudentTBL.SecSchool2021, StudentTBL.MInitial, StudentTBL.PEA2021, [Services Received TBL].DateOfService, [Services Received TBL].Service, [Services Received TBL].SubService, [Services Received TBL].ServiceComments, [Services Received TBL].Contact_Time, [Services Received TBL].ServiceID
    FROM StudentTBL INNER JOIN [Services Received TBL] ON StudentTBL.TSID = [Services Received TBL].TSID
    WHERE ((([Services Received TBL].DateOfService) Between #9/1/2020# And #8/31/2021#))
    ORDER BY StudentTBL.LastName, StudentTBL.PEA2021, [Services Received TBL].DateOfService, [Services Received TBL].Service;

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You don't appear to have tried my suggestion involving the Totals icon. Can you attach the db here so I can show you?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    msouriya is offline Novice
    Windows 10 Access 2007
    Join Date
    Aug 2020
    Posts
    11
    Thank you for your assistance! I figured it out.

  10. #10
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Glad you got it sorted.
    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. Replies: 6
    Last Post: 01-15-2019, 11:40 PM
  2. Replies: 3
    Last Post: 07-20-2014, 08:56 PM
  3. Replies: 1
    Last Post: 11-08-2012, 02:55 PM
  4. How to not show duplicate records in query?
    By JimmD43 in forum Queries
    Replies: 3
    Last Post: 05-29-2011, 02:54 PM
  5. Replies: 1
    Last Post: 05-21-2010, 02:22 PM

Tags for this Thread

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