Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2011
    Posts
    11

    Unanswered: Eliminate duplicate unique items in count

    I have a patient database where of course each patient has their own unique ID# [PatientID]

    I need to create reports to show the total amount of patients receiving services. In a period of time, any one patient can receive a few to several hundred services. Between my query and report, how can I achieve the "actual" number of patients without duplicates of the [PatientID]?

    Thank you!!

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    I can't supply the precise SQL statement without knowing the definitions of the table involved and their relationships, but it could be something like:
    Code:
    SELECT Count(PatientID), ...
    FROM...
    WHERE...
    GROUP BY PatientID
    HAVING...
    The WHERE and HAVING clause being optional and depending on the actual structures of the database.
    Have a nice day!

  3. #3
    Join Date
    Jun 2011
    Posts
    11

    No true "relationships" in DB

    The database I'm working in actually pulls info from another DB, which unfortunately doesn't have the ability to create the exact reports that we need. I'm forced to create my relationships by building various queries and creating the relationships there...

    The table (TicketDetail) is where I'm pulling the true (PatientID) from.

    The (PatientID) is linked from (TicketDetail) to a query (qryLevel 1 Patients) that pulls specific patient types from the (TicketDetail) table also. This is necessary due to the fact that when a patient switches levels, a "ticket" is created to reflect this.

    I know my way around the db fairly well, I apologize however, I'm not very well versed in the "technical" terms but I'm learning.

    Thanks again!!

  4. #4
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You're welcome!
    Have a nice day!

Posting Permissions

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