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

Not like

Status
Not open for further replies.

auburnfan

Technical User
Jan 4, 2006
22
0
0
US
Ver 9
Ok, I need to figure out what is not in {table.B} that is in {table.A}
Example
{table.A} {table.B}
1 1
2 3
3 4
4 6
5 7
6
7

I need the report to find that 2 and 5 are missing in {table.B}
any suggestions?
 
Post your database type...

This looks like an excellent candidate for a MINUS type of query, ask your dba about them.

btw, most would phrase this as show everything in Table A that is not in Table B

An add command of:

select id from tablea
minus
select id from tableb

Or an Add Command of:

select id from tableA
where id not in
(select id from table b)

This is all theory, not a guaranteed match for your database becase again, you ask about data and queries but don't post what database you're using.

ALWAYS post your Crystal version and the database/connectivity used for the best responses, otherwise your saving the 10 seconds costs everyone more time, including yourself.

You can also do this within Crystal, but passing the right SQL to the database from Crystal is the way to go.

-k
 
Or you could use a left join FROM Table A to Table B and then use a record selection formula of:

isnull({tableB.ID)

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top