0

Hi I have a problem in formulation of query: project object is master of proj team. When employee start date is 12-7-2017 (which is in mid week- Wednesday) and end date is 30-12-2017, i am not getting the record for project. If i keep the employee start date as 10-7-2017 (Monday). I am getting the record. And the comparison will always be start of monday and sunday dates as given below.

 SELECT Id, Name, project_type__c, Project_Start_Date__c,Project_End_Date__c FROM Project__c WHERE ID IN(SELECT Project__c From Proj_Team__c WHERE Employee__c = 'a010k000000x9yd' AND Emp_Start_Date__c <= 2017-07-10 AND Emp_End_Date__c >= 2017-07-16) 
2

You have to check on your condition.

I guess Your looking for the employee who's starting date is after 2017-07-10 or equal to 2017-07-10. And Employee End date is before 2017-07-16 or equal to 2017-07-16.

SELECT Id, Name, project_type__c, Project_Start_Date__c,Project_End_Date__c FROM Project__c WHERE ID IN(SELECT Project__c From Proj_Team__c WHERE Employee__c = 'a010k000000x9yd' AND Emp_Start_Date__c >= 2017-07-10 AND Emp_End_Date__c <= 2017-07-16)
2
  • If you check the dates with the query still the query fails. – Effat Naaz Sep 6 '17 at 12:22
  • @EffatNaaz what error your getting ? – NITHESH K Sep 7 '17 at 4:38

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.