You need to sign in to do that
Don't have an account?
GMASJ
Get latest record in soql query
Hi,
I want to get the latest record from the query below please suggest me a logic.
Thanks
I want to get the latest record from the query below please suggest me a logic.
list<case> ctendays = [select id, casenumber,subject,createddate,ownerid,owner.name from case where CreatedDate = this_year and subject like :('%' + CaseSubject + '%') order by createddate asc limit 10];
Thanks
list<case> ctendays = [select id, casenumber,subject,createddate,ownerid,owner.name from case where CreatedDate = this_year and subject like :('%' + CaseSubject + '%') order by createddate asc limit 10];
// Add Limit as 1 and Use DESC
list<case> ctendays = [select id, casenumber,subject,createddate,ownerid,owner.name from case where CreatedDate = this_year and subject like :('%' + CaseSubject + '%') order by createddate DESC limit 1];
Thanks,
SEKAR RAJ