Results 1 to 4 of 4
  1. #1
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    102

    Query: count appearances in another query

    Hello,



    So I have two queries:
    1. [qryStatusPerEmployee]
      • [FullName]
      • [Goal]
      • [Valid]

    2. [qryValidCertifications]


    • [FullName]
    • [Station]
    • [Status]

    So in query #1 you have the list of employees, with the goal of certifications to have and in query #2 you have the list of valid certifications, where a single employee can appear several times, because he can be certified in different stations, the status already filters the valid certifications from the expired ones.

    I would like to have in the [valid] column on query #1, the count of how many times that employee appears in the second query, so that I obtain the number of valid certification each employee has.

    Thanks for your time in advance!

  2. #2
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    You should use an autonumber or other unique number as the PK for the employee, if someone has same name it would cause issues. Can you give an example of data in both tables and what you want the final to look like?

  3. #3
    epardo87 is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Dec 2016
    Posts
    102
    Thanks, I do have a unique number for each employee in the original table, but I concatenated the full name (name, father's lastname and mother's lastname) so it is very unlikely to have the full name duplicated, nevertheless, I'll begin to use it, because, you may never know right?

    well, actually I managed to figure it out: I created a third query, placed twice the [FullName] from the 2nd query, totaled it and changed the second column to count, that gave me the number of times each employee appears in the valid certifications. then I included that column in the first query and it works fine!

    Thanks!

  4. #4
    Bulzie is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    Nov 2015
    Posts
    1,511
    Awesome, good job !!

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

Similar Threads

  1. Replies: 5
    Last Post: 02-08-2017, 05:52 PM
  2. Replies: 2
    Last Post: 06-30-2016, 06:38 PM
  3. Year Count and Month Count Same Query
    By NateSmith in forum Queries
    Replies: 1
    Last Post: 05-13-2015, 08:23 AM
  4. Replies: 2
    Last Post: 04-15-2014, 01:59 PM
  5. Replies: 7
    Last Post: 05-02-2012, 08:04 AM

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