+ Start a Discussion
Peter BölkePeter Bölke 

SOQL Query Campaign.EndDate + n Days

Hello,

i need to return a list of Campaigns which fullfill following requirement

WHERE Campaign.StartDate <= Today AND Campaign.EndDate + 7Days > Today

How can i do this in SOQL?

Thanks
Peter
Best Answer chosen by Peter Bölke
Jolly_BirdiJolly_Birdi
@Peter then add a new check as well go with this query:

WHERE Campaign.StartDate <= Today AND Campaign.EndDate > LAST_WEEK AND Campaign.EndDate < NEXT_WEEK

Please like and mark it as best answer if you find it positive.


Thanks,
Jolly Birdi

All Answers

Jolly_BirdiJolly_Birdi
Hello @Peter

Try this below:

WHERE Campaign.StartDate <= Today AND Campaign.EndDate > LAST_WEEK

Please like and mark it as best answer if you find it positive.


Thanks
Jolly Birdi
Peter BölkePeter Bölke
Hello @Jolly,

thanks for your answer.
But this would include any Campain that ends in future. But it should only include Campaigns that had ended Enddate + 7Days. Your suggestion  includes EndDate + 8,9,10......

 
Jolly_BirdiJolly_Birdi
@Peter then add a new check as well go with this query:

WHERE Campaign.StartDate <= Today AND Campaign.EndDate > LAST_WEEK AND Campaign.EndDate < NEXT_WEEK

Please like and mark it as best answer if you find it positive.


Thanks,
Jolly Birdi
This was selected as the best answer