Results 1 to 5 of 5
  1. #1
    sergi117 is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2018
    Posts
    30

    Attempting to create sum count if query

    Hey everyone I have two tables of data. One containing names and hire dates, the other containing pay periods. I would like to make a query which counts if the hire date is within the pay period (<= ending date) and sums the counts. However in attempting this, I get results which are far too high, naturally because these tables aren't joined together. Unfortunately there are no real columns which the two tables can be joined with. Is there any solution for this so I might be able to get a sum of the counts? Perhaps an alternative to count or something?

    Table 1
    Name1... Hire Date1
    Name2...hire date2

    Table 2


    Date beg...date end
    Date beg2..date end2
    Etc

  2. #2
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Access 2016
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,538
    Probably a parameter query where in the criteria for the HireDate field you will place the following

    Between #1/3/2018# and #1/17/2018#

    changing the dates as appropriate.

  3. #3
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    this might be a repeat of this post
    https://www.accessforums.net/showthread.php?t=73998

    It's not clear in either thread if the person factors into this problem. I doubt there is a way to relate the hire date of a person to any pay date when the person can't be related to that date. Again, it's not clear if that is the goal, but I'm thinking it's not.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  4. #4
    sergi117 is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2018
    Posts
    30
    Fixed it actually, turns out since there were duplicate records, the sum(iif was resulting in multiple counts. A simple select distinct and then sum(iif solved my issues. I'd mark this as solved, but I'm unsure how.

  5. #5
    sergi117 is offline Advanced Beginner
    Windows 10 Access 2013 32bit
    Join Date
    Sep 2018
    Posts
    30
    Found the solved selection nvm.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-12-2017, 11:42 AM
  2. Attempting to up date a Query.. PLEASE HELP!!
    By tbowling19 in forum Access
    Replies: 2
    Last Post: 12-07-2016, 01:22 PM
  3. Replies: 1
    Last Post: 07-03-2014, 08:27 PM
  4. Create Count in Query
    By StewartS in forum Queries
    Replies: 2
    Last Post: 02-21-2014, 05:42 AM
  5. Replies: 1
    Last Post: 10-29-2012, 02:02 PM

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