How do I compare a date field?
I have 2 objects ObjectA and ObjectB and I would like to run a query for ObjectB that is DateFieldB = DateFieldA.
Here is my Line:
for(ObjectA__c A : Trigger.New)
{
if(A.DateFieldA__c != NULL)
{
Map<Id, ObjectB__c> B = new MapMap<Id, ObjectB__c>
(
[
SELECT Id, DateFieldDateB__c
FROM ObjectB__c
WHERE DateFieldB__c = A.DateFieldA__c
]
);
}
}
I am having this error:
Error: Compile Error: expecting a colon, found A.DateFieldA__c at line 13 column 40.