Results 1 to 7 of 7
  1. #1
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46

    Post Multiple Date Fields based on Criteria on the same Report Row

    Multiple Date Fields based on Criteria on the same Report Row




    Bear with me as I try to explain my situation. I have a huge table - don’t ask – I inherited it, and yes, we are making headway).

    Along with the standard name, and employee ID #, this table contains multiple fields to track license expirations, based on the type of equipment. To keep it simple, they are [Equip1License], [Equip2License], [Equip3License], etc., and for this part of my project, there are 9 total License fields I am working with.

    Additionally, each of the different types of equipment has an [active] field tied to. This is a check box next to each date field. Essentially, not all employees are licensed for each of the 9 different pieces of equipment, and for the equipment they are licensed for, their current status on that equipment is either “active” or if unchecked, then “non-active”.

    For example:

    [Equip1License], [Active]
    [Equip2License], [Active]
    [Equip3License], [Non-Active]
    [Equip2License], [Active]
    [Equip3License], [Non-Active]

    Every 2 years, the employee must recertify on the equipment for which they are licensed on. On the form that is used to show the status for each employee, we use conditional formatting to visually show the status of the License dates in terms of how close they are to expiring. Anything before today’s date will be red, meaning that technically their license had expired, and anything from today’s date looking forward +60 days, is shown in yellow, as an indicator that the expiration is coming due soon. That works fine.

    I have individual reports for each piece of equipment, with the same conditional formatting on the license dates, and again, those work fine.

    Finally…..here is where I am struggling. I have need for an overall license report for all 9 license fields, on the same report. I have set up induvial queries, that filter by active (-1), and then set the license date field criteria to “<Date()+60”. This pulls back all records of those employees who are active, and who’s license is either already expired or will be in the next 60 days. Again, each query works fine.

    What I am doing with each of the 9 queries is appending them to a table, that has a field for employee name, employee # number, and then a field for each of the (9) license dates (one for each append query). You can see where this is going – if an employee has more than one license that is meets the criteria, then it creates a different record for each type of equipment. And when I carry this through to the report, the same issue applies.

    [Employee Name] [Equipment1] [Equipment2] [Equipment3] [Equipment4]
    Jones, Bill 02/01/2020
    Jones, Bill 01/19/2020
    Jones, Bill 02/22/2020


    What I would like is for everything to be on the same row as this:

    [Employee Name] [Equipment1] [Equipment2] [Equipment3] [Equipment4]
    Jones, Bill 02/01/2020 01/19/2020 02/22/2020
    Smith, John 03/03/20
    Taylor, James 12/15/19 02/20/2020

    I have tried using the group function in both the query, and on the report, but is still “stacks” the dates.

    Any ideas would be greatly appreciated. I know I am close, but just missing that last piece of the puzzle.

    Thanks.

  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,518
    Well, the first problem is the non-normalized design. Each license I'm approved for should be a record in a related table, not a field. What happens when somebody comes up with a 10th license? You've got to redesign tables, forms, reports, queries...

    Even with this design, you shouldn't have needed 9 queries. You should have been able to put a criteria on a different line for each license. That gives you an "OR" comparison instead of "AND". You said you tried the group function, but it sounds like you grouped on something other than name. The license fields should have had Max.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46
    pbaldy, as I mentioned, this was an inherited system and I fully understand the correct design methodologies. There would be a lot of this db that would be redesigned if I had the time, but that is not possible at this point. Also, there are 5 other fields that go with the license expiration date, so these are not standalone fields. I will try the max criteria on the license fields to see if that provides the correct output. Thanks.

  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,518
    I understand. I'd go back further and try with a single query, with criteria on different lines. In SQL view, that's OR instead of AND.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46
    Thanks for the guidance. I will try the single query as you mentioned. I should have thought of that direction first. Thanks so much.

  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,518
    No problem, post back if you get stuck. If you post a sample db I can try to show you.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    MSAccessOldTimer is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    May 2012
    Posts
    46
    Thank you, I really appreciate the help. It will be early next week before I can get back to that project, and if I get stuck, I will do as you mentioned, and attached it for you to look at it.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-21-2017, 03:07 PM
  2. Replies: 3
    Last Post: 02-20-2017, 08:27 AM
  3. Replies: 3
    Last Post: 07-26-2016, 02:12 PM
  4. Report based on Multiple Date Fields
    By viper210 in forum Reports
    Replies: 11
    Last Post: 09-27-2012, 07:07 AM
  5. Replies: 12
    Last Post: 05-07-2012, 12:41 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