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
Sales Force FRMSales Force FRM 

How to write a SOQL query to go back 1 hour back from currnt date

Hi
       How to write a SOQL query to go back 1 hour back from currnt date and my SOQL is as follows:

SELECT ID,NAME,TYPE,BillingStreet,BillingCity,BillingState,BillingCountry,Phone,Industry,OwnerShip,OwnerId From Account Where  LastModifiedDate>(CURRENTDATE-1hr)


Now how to subtract 'n' hours  from current date and time so that i can get the records which are modified 'n' hours back.
Any good suggestions appreciatable.

Thanks & Regards,

Rajeshwar.


SuperfellSuperfell
You can't do the calculation in SOQL, you'll need to either have a formula field that indicates the result of your last modified check, or calculate the 1 hour from now in java and pass in the literal value with the query.
Sales Force FRMSales Force FRM
Thanks for your reply!
                            Here Iam Cast Iron Integration appliance , but iam getting this error:
                            Internal error in Salesforce.com connector. Error is: null what is it?