# Accounts without contacts

**URL:** <https://community.spicecrm.io/t/accounts-without-contacts/34>\
**Category:** KReporter\
**Created:** [December 1, 2016, 1:32pm UTC](https://community.spicecrm.io/t/accounts-without-contacts/34 "2016-12-01T13:32:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nommaz](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spicecrm.io/nommaz/32/8_2.png) [@nommaz](https://community.spicecrm.io/u/nommaz)\
**Post date:** [December 1, 2016, 1:32pm UTC](https://community.spicecrm.io/t/accounts-without-contacts/34/1 "2016-12-01T13:32:24Z")

</div>

This question is for Kreports gurus. Often, i need to get a list of all objects not having a type of child relationship. Accounts without contacts is a good example. I notice under select you can set the required field to Notexisting if Operator is function, however it doesnt do the job.

To work around I set everything as optional, do a group by, count the child id and sort descending so the 0s are at the bottom but its not ideal.

Is there a proper way to do this type of queries?

Thanks!

---

<div class="post-metadata">

**Author:** ![maretval](https://avatars.discourse-cdn.com/v4/letter/m/b38774/32.png) [@maretval](https://community.spicecrm.io/u/maretval)\
**Post date:** [December 1, 2016, 3:04pm UTC](https://community.spicecrm.io/t/accounts-without-contacts/34/2 "2016-12-01T15:04:30Z")

</div>

Notexisting under select is not implemented. For your purpose you need to query on null ids for contacts.  
Using Accounts as root module, go to SELECT tab  
Accounts \> Contacts =\> ID field from contacts  
Operator =\> is null  
Required =\> optional

 ![](https://canada1.discourse-cdn.com/flex030/uploads/spicecrm/original/1X/3023f120fee49d6a0b3b732a8cc2548a2b041eb6.PNG)

---

<div class="post-metadata">

**Author:** ![nommaz](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spicecrm.io/nommaz/32/8_2.png) [@nommaz](https://community.spicecrm.io/u/nommaz)\
**Post date:** [December 4, 2016, 6:56am UTC](https://community.spicecrm.io/t/accounts-without-contacts/34/3 "2016-12-04T06:56:33Z")

</div>

Dear Val, Works like a charm i have been struggling with this for two years. Cant tell you how much I appreciate your help!! Vedat
