11/25/2024 4:22:03 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss general T-SQL questions and help with queries related to SalesLogix data. View the code of conduct for posting guidelines.
|
|
|
|
Help creating contact group for contacts without any records.
Posted: 05 Sep 06 8:14 PM
|
fiogf49gjkf0d I would like to create a contact group, that lists only contacts without any history (ie. notes, opportunities, tickets, activites, history, etc...). Is there a way to do that?
I've been successful in creating this report showing the contacts WITH history, but cannot do the alternate (WITHOUT history).
To do that I set the condition to: Contact .Contactid in (select distinct a1.contactid from history a1) AND Contact .Contactid in (select distinct a1.contactid from ticket a1) AND Contact .Contactid in (select distinct a1.contactid from opportunity a1) AND Contact .Contactid in (select distinct a1.contactid from activity a1) END
Putting this condition inside NOT() results in an empty recordset.
I basically want to create this group so that I can use it to purge contacts without any history. Perhaps I am going about this all wrong and there is an easier way to accomplish this?
Any ideas? Thanks in advance! |
|
|
|
Re: Help creating contact group for contacts without any records.
Posted: 05 Sep 06 9:05 PM
|
fiogf49gjkf0d Try a group with these conditions:
Contact .Activity.Activityid (does not contain data) AND Contact .History.Historyid (does not contain data) AND Contact .Ticket.Ticketid (does not contain data) AND Contact .Opportunity_Contact.Opportunity.Opportunityid (does not contain data) END
You will also need change the joins between Contact -> Opportunity_Contact and Opportunuty_Contact -> Opportunity to LEFT joins. |
|
|
| |
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|