You need to sign in to do that
Don't have an account?
Jeremy Krebbs
SOQL Query last modified date of lookup recored
I need to pull any Projects were the EDI_Result__c LastModifiedDate = today. I can't seem to figure out how to right my query. Below is what I have right now. EDI_Result__c is a look up field.
SELECT EDI_Result__c FROM Project__c WHERE LastModifiedDate = today
SELECT EDI_Result__c FROM Project__c WHERE LastModifiedDate = today
If you are looking to retrieve all projects modified today then below SOQL should work
SELECT ID, EDI_Result__c FROM Project__c WHERE LastModifiedDate = TODAY
If you are looking to retrieve all projects where their related lookup record (EDI_Result__c) is modified today then use below SOQL
SELECT EDI_Result__c FROM Project__c WHERE EDI_Result__r.LastModifiedDate = TODAY
Let us know if this helps.
All Answers
If you are looking to retrieve all projects modified today then below SOQL should work
SELECT ID, EDI_Result__c FROM Project__c WHERE LastModifiedDate = TODAY
If you are looking to retrieve all projects where their related lookup record (EDI_Result__c) is modified today then use below SOQL
SELECT EDI_Result__c FROM Project__c WHERE EDI_Result__r.LastModifiedDate = TODAY
Let us know if this helps.
The Error says: value of filter criterion for field 'LastModifiedDate' must be of type dateTime and should not be enclosed in quotes.
convert youre string value to a date use below as an example.
datetime d = date.valueOf('2023-01-30T00:00:00Z');
SELECT ID, EDI_Result__c FROM Project__c WHERE LastModifiedDate = :d