Hello all,

 

What would be the best way to pull the max date?  I currently have a
table where I have various patients with multiple admission dates.  

Example:  

                PatientID             AdmitDate

                1234                       06/01/2005

                1234                       07/01/2008

                5678                       07/15/2008

                9999                       04/01/2005

                9999                       04/15/2006

                9999                       06/25/2007

 

I would like to create a temp table with the patients last (most recent)
admission.    

Example:

                PatientID             AdmitDate

                1234                       07/01/2008

                5678                       07/15/2008

                9999                       06/25/2007

 

I am unable to just select the patientid max admission date, have been
trying variations of the following:

 

                SELECT DISTINCT(patientid), MAX(admission) FROM
residents GROUP BY patientid

 

But this doesn't pull the max date.  I was only able to find this info
on the function max:

 

The function LMAX is not the same as the function MAX, which is used
only with the

SELECT command.

 

 

 

Jennifer Roberts

Business Applications Specialist

Ohio Masonic Home

937.525.3080

x5788

 


This electronic message contains information from The Ohio Masonic Home, its 
operating subsidiaries or affiliates. The information may be confidential, 
privileged or otherwise protected from disclosure. The information is intended 
to be received solely by [email protected], for use as designated in the 
message. If you are not the designated recipient, you are instructed not to 
review, disclose, copy, distribute or otherwise use of this transmission or its 
contents.  If you have received this transmission in error, please notify The 
Ohio Masonic Home immediately at [EMAIL PROTECTED]; in addition, please delete 
your record of transmission. Sending, receiving, downloading, displaying, 
printing material that is harassing, fraudulent, offensive, intimidating, 
defamatory, or otherwise unlawful or inappropriate is strictly prohibited by 
The Ohio Masonic Home.

Reply via email to