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
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?