Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

Retrieve Most Recent Activity in SQL

$
0
0

Good Day

I have a table of Activities that occurred in different dates and can be retrieved with the query bellow:

Select	Activities.activityid,
		Activities.ActivityTypeCode,
		Activities.ActivityDate,
		Activities.SequenceOrder,
		Activities.Place,
		Activities.TypeOfPlace
From Activities
Where Activities.ActivityTypeCode In ('LOST', 'FOUND', 'NOT SEEN')

 

Queston: How can I retrieve the most recent one? or the second most recent?

For your info: There is a certain field called sequenceOrder that tracks the sequence when the activities are being entered.

Please help.




Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>