function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Pavushetti Abhilash 3Pavushetti Abhilash 3 

SOQL QUERY TO FETCH LATEST RECORD AS PER TIME

Please write a soql query to get latest record as per latest date and time.
Eg: select id, name from case  ORDER BY createdDate
I need to display record in table as per latest record created by time default.
CharuDuttCharuDutt
Hii Pavushetti
Try Below Query
select id, name from case  where  createdDate = Today
OR
select id, name from case order by createddate DESC
Please Mark It As Best Answer If It Helps
Thank You!
Suraj Tripathi 47Suraj Tripathi 47
Hii Pavushetti,
Here is the solution:
Please try this:
select id, name from case order by createdDate DESC

Thanks