You need to sign in to do that
Don't have an account?
Gaurav Idnani
Please spot error in SOQL query
SELECT Id
FROM Leave_Request__c
WHERE
from_date__c>= :reqApp.from_date__c AND from_date__c <= :reqApp.to_date__c
OR
to_date__c>= :reqApp.from_date__c AND to_date__c <= :reqApp.to_date__c
AND
Resource__c = :UserInfo.getUserId()
FROM Leave_Request__c
WHERE
from_date__c>= :reqApp.from_date__c AND from_date__c <= :reqApp.to_date__c
OR
to_date__c>= :reqApp.from_date__c AND to_date__c <= :reqApp.to_date__c
AND
Resource__c = :UserInfo.getUserId()
Below Query can fulfill your requirements, Hope this will work for you.
Please mark this as best answer if this solves your problem.
Thank you,
Ajay Dubedi