Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Identifying records not appearing in another table Post Reply Post New Topic
Author Message
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Topic: Identifying records not appearing in another table
    Posted: 30 Oct 2012 at 9:11am
Hello CRB Forum people.

I am trying to identify records from one table that do not have a correlating value in another table, but cannot figure out how to do so.

Disclaimer: I am relatively new to CR. I have taken a training course, but am still pretty green. I have been browsing the forum and found similar threads, but the answers were too technical for me to adapt for my own use.

Table 1 is an asset record table.
Table 2 is a work routine table.
I need to select all assets in Table 1 that do not have values in Table 2 (all the records that are not assigned to routine work).

I have already created a report that shows me which routine work programs are assigned to the assets in table 1, but I noticed there are some assets missing, which means they have not yet been assigned to a work routine. I am confident CR can do this instead of me having to filter through all 3500+ records individually to find them.

Any suggestions?
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Oct 2012 at 9:14am
outer join table assests to routine
place the field from assets on the canvas that yuo want to see
in the select expert look of the missing values from table2 on whatever field you joined table 1 to table 2 on:
isnull(table2.join_id)
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 30 Oct 2012 at 9:31am
In theory, that makes perfect sense.

Here is what I tried:
{WTHYDRNT.HY_NUMBER} isnull {WKRTSYSID.RS_LINK1}

My asset record is left outer joined to my work routine record.

However, I get an error message that says, "isnull {WKRTSYSID.RS_LINK1} does not appear to be part of the equation".

Any tips?
Thank you for your patience!
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 30 Oct 2012 at 9:35am
in the select expert you just want to write a boolean statement about the full data set that was returned by your joined tables.
Assuming WKRTSYSID is your 'rountine' table use this as your select statement:
 
isnull ({WKRTSYSID.RS_LINK1})


Edited by DBlank - 30 Oct 2012 at 9:36am
IP IP Logged
adavis
Senior Member
Senior Member


Joined: 30 Oct 2012
Online Status: Offline
Posts: 104
Quote adavis Replybullet Posted: 30 Oct 2012 at 9:44am
Thank you DBlank!

Got it. I really appreciate your help!
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.