I am a fresher and i am not able to represent in coding format for the previous week logic. The requirement is i have a date field called funding date.I have to fetch the records where this date field have previous week's date. For example,

SELECT fund__c,amount__c where funding_Date__c=previous week.

In the query,in the place of previous week i dont know what logic i have to use so that i can fetch when that date field has previous week dates.

Please help.



You can use the date literal LAST_WEEK:

SELECT Fund__c, Amount__c FROM Funding__c WHERE Funding_Date__c = LAST_WEEK

Use Date Formats and Date Literals in salesforce.

SELECT fund__c,amount__c where funding_Date__c=LAST_WEEK

you can use something like this SELECT Id FROM Account WHERE CreatedDate > LAST_WEEK

SELECT fund__c,amount__c where funding_Date__c=LAST_WEEK

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.