function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Amitkumar15Amitkumar15 

SOQL Query Issue

Hi,

 

 

I have a SOAL to write which will pick all article which will expire in coming 14 days. i have a field Expires_c on article type.

 

[SELECT Id,createdById, ArticleNumber, KnowledgeArticleId,  Expires_c FROM TEST__kav WHERE and PublishStatus = 'online' AND Language = 'en_US'].

 

What condition i have to add in where clause to achive this.

 

 

Any help.

 

 

wt35wt35

Have you tried appending this?

 

AND Expires__c = NEXT_N_DAYS:14

 

 

sandeep@Salesforcesandeep@Salesforce

Date Expired_Date = system.today().addDays(14) ;

 

[SELECT Id,createdById, ArticleNumber, KnowledgeArticleId,  Expires_c FROM TEST__kav WHERE and PublishStatus = 'online' AND Language = 'en_US'  AND Expired__C <: Expired_Date ].

 

Here is Expired__C  is field on object. ( please check if I did spelling mistake)