How would I convert this query to ANSI 92 standard? select p.InternalID, n.LastName from tblPatient p, tblName n where p.PatientID = n.EntID and n.EffDt = ( select max(n2.EffDt) from tblName n2 where n.EntID = n2.EntID and n2.EffDt <= getdate() )
Oh, one more. You should be explicite on you INNER JOIN and move the join condition away from the WHERE clause. [<img src='/community/emoticons/emotion-1.gif' alt='' />]<br /><br />--<br />Frank<br /<a target="_blank" href=http://www.insidesql.de>http://www.insidesql.de</a><br />