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
Jakson MonteiroJakson Monteiro 

SOQL Query Date

How can i query to find all accounts  records that have been created last hour before. Like if we load data in salesforce at 1pm using a external tool  how can i query in salesforce and check the count of all the records created at that specific time. I know salesforce has date literals but there is nothing on hourly basis.
surasura
sadly as i  know there are no direct way to get above result using only a single soql query but you can try somthing like below using  developer consloe execute anonymous


Datetime d = datetime.now().addhours(-1); and use this variable in yor query