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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excluding records based on values in another table

Status
Not open for further replies.

MAM

Programmer
Sep 12, 2000
5
US
I have two tables,

ADMINISTRATOR
UserID
Field1
Field2
.
.
.
AUDIT_TABLE
UserID
WhatIDid
AnotherField
.
.
.

I would like to create a report of the Audit_Table excluding the UserID's that exist in the Administrator table. The Administrator table changes frequently (about once a week or so), so I'd like to dynamically determine the UserID's from the Administrator table. Does anyone know how to do this? I'm connecting to my data via ODBC.

Thanks in advance,
MAM

 
hi mam

use query as follows.

select * from audit_table where userid not in
(select userid from administrator )

hope it works
 
That will work within SQL.

If you have to work within CR the approach is to link from User to Admin with a left outer join. Then use a selection formula like:

IsNull ( {Admin.UserID} ) Ken Hamady, On-site/Phone Crystal Reports Training/Consulting
Quick Reference Guide to using Crystal in VB
 
for non sql writers, th eresord selection formula is crystal would read isnull({ADMINSTRATOR.UserId})
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top