Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

where Conditionals in Database expert

where Conditionals in Database expert

where Conditionals in Database expert

I am trying to to see if the database expert in Crystal has a way where I can put my where conditionals in it instead of the select expert.

The issue I am facing is that since I have 8 reports in the report where 5 of them are the same table but with different aliases, it is causing an implicit Inner join.

I have tried altering the select expert to say the following, but no luck.
(Isnull({BU.UserFieldProfile_ID}) OR {BU.UserFieldProfile_ID} = 10052)
(Isnull({lrec.UserFieldProfile_ID}) OR {lrec.UserFieldProfile_ID} = 10023)

RE: where Conditionals in Database expert

Please describe the what you are trying to achieve in terms of the data set returned. If you left join tables, but then add a selection criterion on the right hand table, it will effectively undo the left join. You can either remove the selection criteria and use the criteria in conditional formulas in the body of the report to return desired fields, or you can use the "add command" feature (above the tables in the database expert), and write a command to use as your sole datasource, where you add the criteria in the "From" clause instead of the "Where clause"


Select table.field
From table
left join table_1 on
table.key = table_1.key and
table_1.ID = 10052
left join table_2 on
table.key = table_2.key and
table_2.ID = 10023

This would preserve the left joins.


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close