web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Finding Contacts w/o any Activity

(0) ShareShare
ReportReport
Posted on by 80

Hello,

I have a database with tens of thousands of contacts and I would like to pick the ones out that have never had any sort of activity associated with them.  Is there a way to do this?

Thanks,
Tom

*This post is locked for comments

I have the same question (0)
  • Wes Weeks Profile Picture
    530 on at
    Re: Finding Contacts w/o any Activity

    It depends what you want to do with the list.  There isn't a method I'm aware of from within CRM to get this list but you can create a report/query to get at the data.

    Running this against your database should get you what you need:

    select contactid, fullname
    from contact c
    where not exists
    (select 'x' from activitypointer where regardingobjectid = c.contactid)

     

  • Tom Waite Profile Picture
    80 on at
    Re: Finding Contacts w/o any Activity

    Worked like a charm, thank you!

    Would you be able to do something similar to find accounts that do not have any history associated with them?

  • Wes Weeks Profile Picture
    530 on at
    Re: Finding Contacts w/o any Activity

    You could do something similar but it would be a little trickier.  The reason is that activities rollup from a contact to their parent account if one exists.  So if I have a closed task with Bob that is in Bob's history, it will also show up in the history for the account bob is associated with.

    Are you trying for only items with no history?  What about open activities for an account?

  • Tom Waite Profile Picture
    80 on at
    Re: Finding Contacts w/o any Activity

    Ideally I would only want accounts that have no history or open activities but if that complicates things too much, finding accounts with no history regardless of open activities would certainly do.

  • Wes Weeks Profile Picture
    530 on at
    Re: Finding Contacts w/o any Activity
    That actually makes it a little easier.  The following should do it:

    select accountid, name
    from
    account
    where accountid not in
    (
         select accountid
        
    from account a
        
    where exists
             
    (select 'x' from activityparty ap where ap.partyid = a.accountid)
    )

  • Tom Waite Profile Picture
    80 on at
    Re: Finding Contacts w/o any Activity

    Hi Wes,

    Thanks again for the help.  This time it seems that it did not filter out many of the accounts that have closed activities in their history.  This may have nothing to do with anything but we did alot of record merging with our database so maybe that is causing the problem?  Any other suggestions?

    Thanks,
    T

  • allen1 Profile Picture
    60 on at
    Re: Finding Contacts w/o any Activity

     Maintaine you database in a unique way

    ====================================================================

    allen

    [url="http://www.astro4all.com"]freeastro[/url]

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans