Results 1 to 3 of 3
  1. #1
    stalk is offline Competent Performer
    Windows 8 Access 2003
    Join Date
    May 2014
    Posts
    147

    How to get the list of patients based on 3 fields by using subquery

    I have about 8 patients with at least 6 to 10 records per patient. PID is different but the Patient fname, lname and state remains same . How can I filter them and extract all the records for these patients, say about 150 records?
    In regular cases using pid I can get using this query select * from ptable where pid in(select pid from table2).



    Thank you

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Are you saying the same person has multiple PID? You need to use combination of fname/lname/state as filter criteria?
    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
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    use a tPicked table for a user to pick the patients from a list. (add a box to filter list by name)
    once all are picked (dbl-click runs append query to add the PID to the table)

    then the main data query joins the tPicked table to the main data vid PID, and only those patients are shown.

    Click image for larger version. 

Name:	pick state lbls.png 
Views:	11 
Size:	27.7 KB 
ID:	40835

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

Similar Threads

  1. Replies: 2
    Last Post: 10-29-2019, 02:24 PM
  2. Patients Living in Lamont
    By swt027 in forum Queries
    Replies: 2
    Last Post: 10-15-2018, 12:56 PM
  3. Replies: 3
    Last Post: 07-26-2016, 02:12 PM
  4. Replies: 11
    Last Post: 11-08-2013, 06:14 PM
  5. Subquery comparing two fields
    By jdcollins in forum Queries
    Replies: 8
    Last Post: 01-17-2011, 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