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
Steve_FinlaySteve_Finlay 

Report Query

I have a custom object with a master-detail relationship with the contact object. The custom object has a date field.

 

I'm wanting to generate a report of contacts that don't have a custom object record with a date within the last 7 days.

skodisanaskodisana

Hi,

 

Select the report type as Contact and Custom object.

In this apply the filter on date like Custom Date field is greater than  LAST 7 DAYS.

 

Thanks,

Kodisana

Steve_FinlaySteve_Finlay

This actually returns no results.

 

What I'm looking for is effectively

 

select distinct * from contact where contact not in ( select * from contact where contact.data equals last week )

skodisanaskodisana

HI,

 

May be code helpful for this.

 

Date d= System.today();
Date d1 = d.addDays(-7);

 

select distinct * from contact where Date > d1

 

Thanks,

Kodisana