we have Order__c as custom object. we are trying to extract the past 30 minutes record.
where LastModifiedDate=TODAY and HOUR_IN_DAY(LastModifiedDate) > 0.5
is not working
We tried SOQL :
SELECT count() FROM Order__c where LastModifiedDate=TODAY and HOUR_IN_DAY(LastModifiedDate) > 0.5
HOW DO I FETCH PAST 30 minute records only using Where clause filter?
Best Answer
The easiest way might be to make the following
Minutes_Since_Modified__c
formula:Then to query for it:
If you can use
Apex
, then use aDatetime
instance.If not, you can query the literal value as long as you can construct it using ISO 8601. For example at 12:30 PM it would look like: