Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Select records not in another table Post Reply Post New Topic
Author Message
nannythenewf
Newbie
Newbie
Avatar

Joined: 01 Oct 2011
Location: United States
Online Status: Offline
Posts: 2
Quote nannythenewf Replybullet Topic: Select records not in another table
     Posted: 01 Oct 2011 at 2:02am
The end user wants all records suppressed for a person if that person has any records in another table. In SQL would do this by
Select table.id, table.name from table where table.id not in (select table2.id from table2).
Tried in the select expert to use the following
where table1.id_number not in the list of table2.id_number
using Crystal 10 - worked once, never worked again in Crystal 11 did not work at all. Verified the tables I'm using had not changed. Would appreciate any help.
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 03 Oct 2011 at 8:58am
why not:
 
select table.id, table.name from table left join table2 on table.id = table2.id
where table2.id is null
 
you can link the tables with the outer join criteria, and you should be able to filter on the value being null
 
it's worth a try
 
IP IP Logged
nannythenewf
Newbie
Newbie
Avatar

Joined: 01 Oct 2011
Location: United States
Online Status: Offline
Posts: 2
Quote nannythenewf Replybullet Posted: 03 Oct 2011 at 11:31am
Will give that a try. Current have it working with a suppress on the detail line - with basically what you have suggested.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum