Results 1 to 7 of 7
  1. #1
    Futtecr is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    5

    Excluding certain values in Access 2003


    In a query of related tables in a one to many relationship of parent to daughter table. Some parent records will have many daughter table records others will not. How would I formulate a query which can do the following. I want to find out how many patients in the parent table have only 1 record in the daughter table with a certain value. Example: How many patients ONLY had ASD in the daughter table record as opposed to 2 records one with ASD and the next with VSD? I don't want to do this in SQL. Thanks

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    A query is SQL so don't know what you mean by 'don't want to do this in SQL'.

    Try an aggregate GROUP BY (Totals) query that generates a count grouping on the patient ID and field containing ASD/VSD values. Access Help has guidelines on building aggregate query with the query designer.
    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
    mrojas is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Location
    Concord California
    Posts
    72
    Could you provide db: Make copy, remove confidential data, run compact & repair, zip?
    This way we can be of more help.

  4. #4
    Futtecr is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Sep 2012
    Posts
    5
    Due to medical confidentiality issues (as well as shear size of the database), I am unable to provide you with a copy but I can give you a better idea.
    Demographics Table has a unique identifier (caseID) and demographic information as well as mortality information. 1 record per patient (about 350,000 records)

    One of the daughter tables has a record for each surgical procedure.Of course it has caseID as well. If a patient had an ASD and a VSD repair there would be 1 record for ASD and 1 record for VSD.
    Sometimes there are many procedures, sometime just 1. What I would like to do is find the number of patients who have a had an ASD closure (for example) and nothing else. My questions is how to set up a manual query to do that? Thanks in advance

  5. #5
    mrojas is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Location
    Concord California
    Posts
    72
    Rather then trying to create a mock up database, could create a blank database and import into it the table structures of your "live" database?

  6. #6
    mrojas is offline Advanced Beginner
    Windows 7 32bit Access 2007
    Join Date
    Sep 2013
    Location
    Concord California
    Posts
    72
    Click image for larger version. 

Name:	Patients-2.JPG 
Views:	4 
Size:	49.7 KB 
ID:	13749Click image for larger version. 

Name:	Patients-1.JPG 
Views:	4 
Size:	66.9 KB 
ID:	13750Click image for larger version. 

Name:	Patients-2.JPG 
Views:	4 
Size:	49.7 KB 
ID:	13749Click image for larger version. 

Name:	Patients-1.JPG 
Views:	4 
Size:	66.9 KB 
ID:	13750
    A picture is worth...
    Not sure if I duplicated the images; first time I use this website's attachment feature.

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    Did you try the suggestion in post 2?
    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.

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

Similar Threads

  1. Replies: 3
    Last Post: 12-04-2012, 01:09 PM
  2. Replies: 14
    Last Post: 09-21-2012, 11:12 AM
  3. Excluding values based on another table
    By hotpants49 in forum Queries
    Replies: 3
    Last Post: 09-08-2012, 11:15 AM
  4. Replies: 2
    Last Post: 05-21-2012, 02:06 PM
  5. Excluding null values on SQL table query
    By DB2010MN26 in forum Queries
    Replies: 1
    Last Post: 09-03-2010, 12:54 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