Results 1 to 3 of 3

Thread: Min(date)

  1. #1
    Join Date
    Jul 2011
    Posts
    33

    Unanswered: Min(date)

    Hi, I have a database with user defined dates in it for when a person has gone into hospital (admis_date). What I am looking to do is to find the first time a person was admitted to hospital only. ie if a person has attended a clinic for influenza 5 times in their life, i only want to pick out the first time. I have

    Code:
    SELECT DISTINCT Person, MIN(Admis_Date) AS FIRST_DATE, Diagnosis
    FROM DATABASE A
    WHERE Diagnosis = "influenza"
    but this returns all instances of influenza for everyone in the database. Whats going on?

  2. #2
    Join Date
    Jul 2011
    Posts
    33
    it's ok i;ve fixed it.

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    How? Would you mind sharing the solution

    ----
    Visit the new-look IDUG Website , register to gain access to the excellent content.

Posting Permissions

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