Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify records that do not have a corresponding field

Status
Not open for further replies.

tcbc

Technical User
Feb 7, 2009
33
US
I have

123 bug ant
123 bug spider
123 bug worm

How can I pick out records set up as above, that dont contain a corresponding field called Ant. The above would not be on the report because one of the corresponding fields is ant so I wouldnt want to see this record.
 
Insert a group on {table.ID}. Then create a formula like this:

//{@hasant}:
if {table.bugtype} = "Ant" then 1

Then go to report->selection formula->GROUP and enter:

sum({@hasant},{table.ID}) = 0

-LB
 
Yes . Perfect that worked. now can you just kind of summarize/explain what I did with the formula.

 
If you place {@hasant} in the detail section, you will see that it gives a 1 to any record that = "ant". The group selection formula says if there is any record in the group that has "ant", do not select the entire group. It does this by summing the 1's in each group--anything greater than 0 means there is an ant in the group, and therefore the group is not selected.

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top