I've got another noob question...When I run this query to just grab the emp_id I get 6474 but when I request more fields I get 6605?[code="sql"]select distinct CONVERT (varchar(9),EMPLOYEE_ID) AS emp_id, CONVERT(datetime,(CONVERT(varchar(8),ADMISSION_DTE))) AS Adm_date, ADMISSION_CDE, ADMIT_TYPE_CDE, CONVERT(datetime,(CONVERT(varchar(8),DISC_DTE))) AS Dis_date, DISC_CDE, DISC_TYPE_CDEfrom CurrentTableWHERE [BranchID]='950' AND (DISC_DTE IS NULL OR (DISC_DTE > 20120630 AND DISC_DTE < 20130201))order by emp_id , adm_date[/code]...I just want the record for the most recent adm_date what's up with my distinct?
↧