Results 1 to 4 of 4
  1. #1
    TimC is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    34

    Acquiring Items within a Date Range + More

    I’vedeveloped a Microsoft Access Database that includes injury information for severalwork locations and multiple years. I amusing a query to pull DOI/injury data for the current calendar year using a daterange [>=#1/1/2017# And <#1/1/2018#]. Everything is working beautifully!!!

    I now wantto expand the query to show DOI/injuries occurring within the date range plus older injuries from previous years with an “open”claim. The tablehas a “Status” field to identify open and closed claims, but I’m not sure howto achieve both. Any suggestions? Thanks.


  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    make 2 queries, then combine them into a union query.
    remember that both queries must have the exact same fields in the same order.
    union query:

    select * qsDateRng
    union
    select * qsOpenClaim

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I don't know your table or field names, but maybe this will help.

    You have a query that works, I would guess it looks something like:
    Click image for larger version. 

Name:	Qyery1.jpg 
Views:	9 
Size:	33.8 KB 
ID:	28878



    Copy the query and add the second criteria in the new query:
    Click image for larger version. 

Name:	Query2.jpg 
Views:	9 
Size:	31.7 KB 
ID:	28879

    This says return all records WHERE:
    The Injury Date is greater than or equal to #1/1/2017# AND less than #1/1/2018#
    OR
    The Injury Date is less than #1/1/2017# AND the STATUS equals "OPEN"

  4. #4
    TimC is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Oct 2012
    Posts
    34
    The second solution was much easier and did provide the needed info. Thank you.

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

Similar Threads

  1. Replies: 4
    Last Post: 11-20-2018, 11:57 PM
  2. Replies: 3
    Last Post: 01-26-2016, 01:56 PM
  3. Replies: 4
    Last Post: 04-25-2015, 04:17 PM
  4. Replies: 3
    Last Post: 09-11-2013, 09:49 AM
  5. Replies: 1
    Last Post: 03-06-2013, 10:30 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