+ Start a Discussion
Pavan kumar 546Pavan kumar 546 

hii friends how can write soql query for this one pls suggest me..to retrieve the opportunities that are closed on friday in the years 2013and 2015hii friends how can write soql query for this one pls suggest me..

hii friends how can write soql query for this one pls suggest me..to retrieve the opportunities that are closed on friday in the years 2013and 2015hii friends how can write soql query for this one pls suggest me..
Best Answer chosen by Pavan kumar 546
anto nirmalanto nirmal
Hi Pavan,

As I understand your problem statement is:
SOQL for Opportunities with closed date on Friday for the years 2013 and 2015:

Kindly try out the following SOQL statement:

SELECT Name FROM Opportunity WHERE DAY_IN_WEEK(CloseDate) = 6 AND (CALENDAR_YEAR(CloseDate) = 2015 OR CALENDAR_YEAR(CloseDate) = 2013)

Please let me know if that helps.

As a common practice, if your question is answered, please choose 1 best answer.
Additionally you can give every answer a like if that answer is helpful to you.

Regards,
Anto Nirmal

All Answers

anto nirmalanto nirmal
Hi Pavan,

As I understand your problem statement is:
SOQL for Opportunities with closed date on Friday for the years 2013 and 2015:

Kindly try out the following SOQL statement:

SELECT Name FROM Opportunity WHERE DAY_IN_WEEK(CloseDate) = 6 AND (CALENDAR_YEAR(CloseDate) = 2015 OR CALENDAR_YEAR(CloseDate) = 2013)

Please let me know if that helps.

As a common practice, if your question is answered, please choose 1 best answer.
Additionally you can give every answer a like if that answer is helpful to you.

Regards,
Anto Nirmal
This was selected as the best answer
anto nirmalanto nirmal
Hi Pavan,

Was that helpful?