Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
Rita Bhatnagar
Posting Yak Master
172 Posts |
Posted - 2001-05-02 : 13:33:27
|
| What is the best way to replace last in this query.I used Max an it works fine but i don't know it's right or not.SELECT MDS2.CareRecipientID AS CRID, MDS2.MDSID AS LatestMDSID, Last(MDS2_R.RQ2bDate) AS LatestMDS2CompleteDateFROM MDS2 LEFT JOIN MDS2_R ON MDS2.MDSID = MDS2_R.MDSIDWHERE (((Len(Trim(([RQ2bDate]))))>0))GROUP BY MDS2.CareRecipientID, MDS2.MDSIDHAVING (((Last(MDS2_R.RQ2bDate))<[PeriodEndDate]))ORDER BY Last(MDS2_R.RQ2bDate) DESC; |
|
|
|
|
|