Results 1 to 3 of 3
  1. #1
    jimjaix is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    4

    Access Query [SQL]

    Hi



    I have a very complicated situation (as least to me). I have a table that contains Provider ID, Patient ID and Date of Visits. I want to know if it's possible to create a query that will produce the output I want.

    I want to know from all the providers I have, which one (will be multiple providers) have 5 or more patients AND the date of visits need to within 3 consecutive months. For e.g., Dr. A has 8 patients and 6 of those patients visits within 3 consecutive months. So my query will return this Dr. as one of the results. Is it possible?

  2. #2
    Beetle is offline Unrelatable
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    Camp Swampy (Denver, CO)
    Posts
    207
    Is it possible?
    Probably, but more details about your table structure/relationships/fields would be helpful. Also -

    Dr. A has 8 patients and 6 of those patients visits within 3 consecutive months
    can you clarify the above. If Dr. A has 8 patients but only 4 of them have visits within 3 consecutive months, does that still qualify? And, what specifically do you mean by 3 consecutive months? Any 3 month period in the whole history of records, the most recent 3 month period, something else?

  3. #3
    jimjaix is offline Novice
    Windows XP Access 2003
    Join Date
    Feb 2010
    Posts
    4
    Hi Beetle,

    I attached a dummy database, no it wouldn't count if the 4 of them have visits within 3 consecutive months. When i mean consecutive months, I mean the patient was here 3 months in a row, e.g 4/2/13, 5/15/13 and 6/4/13 that would be 3 consecutive months. Another e.g. if patient was here 4/5/13, 5/17/13, 5/28/13 then 7/4/13 then that won't count because there was a month in between that the patient did not show up.

    Hope this will clarify my questions, and thank you in advance for your help. I am not sure how i can code that in access or with SQL via access.

    DummyDB.zip

    Quote Originally Posted by Beetle View Post
    Probably, but more details about your table structure/relationships/fields would be helpful. Also -



    can you clarify the above. If Dr. A has 8 patients but only 4 of them have visits within 3 consecutive months, does that still qualify? And, what specifically do you mean by 3 consecutive months? Any 3 month period in the whole history of records, the most recent 3 month period, something else?

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

Similar Threads

  1. Convert SQL Server Query to Access Query
    By Juan4412 in forum Queries
    Replies: 4
    Last Post: 04-16-2013, 12:41 PM
  2. Replies: 3
    Last Post: 04-24-2012, 08:32 AM
  3. Replies: 34
    Last Post: 02-15-2012, 05:17 AM
  4. Replies: 12
    Last Post: 05-22-2011, 03:49 PM
  5. Replies: 10
    Last Post: 02-02-2011, 05:48 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