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

Record Selection Criteria

Status
Not open for further replies.

Deja99

MIS
Joined
Sep 14, 2003
Messages
2
Location
AU
Hi All,

I'm very new to Crystal so hope someone can help me.

I have an SQL database with information i require to report on based on conditions.

IE I have 2 tables and I want to select information in table 1 based on informtaion contained fields in table 1 & 2 .

IE if i a field in each table called ExSupp. What i want to do is select the record in table 1 only if it does not exist in table 2.

In pseudo;

Select {table1.expsupp} if exists in{table1.expsupp} and not in {table2.expsupp}

I hope i have explained myself clearly, any help is most appreciated.

Thanks




 
Create a left outer join from table 1 to table 2.

Use a selection formula that says:

IsNull ( {table2.Field} )

make sure that there are no other criteria that mention table2.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Hi Kenhamady and thanks for the info.

I already had the left outer join, but can you pleasse be a little more specific with the formula expression.

Sorry to sound like a newbie, but i am !
 
Go into Report - Edit Selection Formula - Record and paste in the following:


IsNull ( {table2.expsupp} )

Of course you should put in the real table name. make sure that this formula doesn't include any other fields from table2.

Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Expert's Guide to Formulas / Tips and Tricks / Guide to Crystal in VB
- tek@kenhamady.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top