+ 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.
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