Results 1 to 8 of 8
  1. #1
    undefatedskillz26 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Chicago
    Posts
    7

    Need to pull query for 2 Status with recent and prior dates

    Hi everyone,

    First time posting here so wanted to say hello to everyone.
    Last edited by undefatedskillz26; 12-23-2014 at 04:00 PM.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    One way to find 'most recent' is with a TOP N parameter nested query. Review http://allenbrowne.com/subquery-01.html#TopN

    However, your additional criteria makes this much more complicated.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    undefatedskillz26 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Chicago
    Posts
    7
    Do you think this would work if it was coded maybe in VBA? There has to be a way for this to work, just dont know which route to go.

  4. #4
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    I don't understand the dates and the 4-day spread. All of the dates you show have more than 4-days in between. One date is the most recent and the second date is the one prior, (filtered by P01), but only if it is within 4-days; is the way I interpreted your criteria.

  5. #5
    undefatedskillz26 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Chicago
    Posts
    7
    Okay I am trying to make this simpler since I am getting deperate here to come up with an answer.

    I need the query to have 2 status for each patient. If both status are the same for each Patient record ID, and is more than 3 business days apart, than I should see it in the query. Is this easier to do?

  6. #6
    JeffChr is offline Advanced Beginner
    Windows 7 64bit Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    82
    No actually that doesn't make it easier. It was a lot easier if the query could just be filtered to P01. OK, so more than 3-days apart. Fine. Post about the P01 filter - firm up our intent with that criteria perhaps an answer will be at hand.

  7. #7
    undefatedskillz26 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Chicago
    Posts
    7
    Okay i created a duplicate Query to find duplicated within the same recordID and Status. It seems to work for now. May have a question on the business days beging greater than 3 days, will do some research. Thank you very much for your time and efforts.

  8. #8
    undefatedskillz26 is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Dec 2014
    Location
    Chicago
    Posts
    7
    Closing thread, thanks everyone.

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

Similar Threads

  1. query for most recent status
    By CurtisHight in forum Queries
    Replies: 1
    Last Post: 11-27-2013, 03:32 PM
  2. Replies: 3
    Last Post: 11-19-2013, 11:48 AM
  3. Replies: 3
    Last Post: 03-01-2013, 12:41 PM
  4. Replies: 1
    Last Post: 12-07-2012, 10:02 AM
  5. Replies: 13
    Last Post: 09-27-2010, 03:10 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