Results 1 to 3 of 3
  1. #1
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Complex Query Problems (2002)

    Please help me with this <img src=/S/help.gif border=0 alt=help width=23 height=15> . I have a database with two tables - a Notes table and a Patients table that are linked on the PatientID field. There can be multiple notes for a single patient, and each note has a note type field that can have a value of A,B,C, or D (not the real values). I need to run a query that will give me all Patients whose source ( a field in Patients table) is "A" and all of their notes of note type = "A". My problem: I need all patients whether they have notes or not, and if they have notes, whether the notes are of type "A" or not. However, the only notes that should be included are notes of type "A". THe purpose of this query is to serve as the basis of a report - I do not need it for the query itself. I can't figure out how to create this query. If someone can help me, I'd be most grateful.

  2. #2
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Complex Query Problems (2002)

    You could do it in a single query using a subquery, but it would be simpler to create a query that just returns the patientID and type "A" notes. Then link that query to your patient table (or whatever) using an outer join (all records from patient table and matching records from the query) and use the resulting query as the source for your report.
    Charlotte

  3. #3
    2 Star Lounger
    Join Date
    Oct 2002
    Location
    Lakewood, New Jersey, USA
    Posts
    187
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Complex Query Problems (2002)

    Thank you Charlotte. I'll try it - it sounds like it'll work. You're a lifesaver - I created these reports already under a mistaken assumption as to their criteria, and I thought I'd have to recreate them (for free <img src=/S/sad.gif border=0 alt=sad width=15 height=15> ). With your advice, it seems like it won't be too much work for me to redo.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •