Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Many thanks to you for putting it together and to the forum members for taking the time to post their replies and give their time to help others. Their isn't another site that can touch it..."

Geography

Where in the world do Tek-Tips members come from?
morles (IS/IT--Management)
20 Jul 12 6:52
I want to create a parameter which has a dropdown list of Customers. However this list is coming from a formula and crystal doesn’t seem to allow this. Is there any way that this can be done?
briangriffin (Programmer)
20 Jul 12 9:55

Can you recreate the formula in SQL? If so, write a command and base the parameter on that - don't link the command to any other tables.

select
customername + someformulamanipulation
from customertable

morles (IS/IT--Management)
24 Jul 12 5:27
Thanks for you response. I can recreate in SQL but as Im using a FULL OUTER JOIN to join two tables a NULL value is returned for every column of the table that lacks a matching row. I would like if there was no match that it returned text

Heres an example of my statement:

SELECT table1.Opp_Id, table1.Name, table1.Objective, table1.Revenue, table1.Name_Type, table4.QuoteNo, table2.Name as CustomerName
FROM ((table1 LEFT OUTER JOIN table3 ON table1.Opp_Id=table3.Opp_Id) LEFT OUTER JOIN table4 ON table1.Opp_Id= table4.Client_Id) FULL OUTER JOIN table2 ON table3.Client_Id=table2.Client_Id
_____________
I would like:
If {Command.CustomerName} = "" then {Command.Name} else {Command.CustomerName}

I know I can do this using a formula but then I wont be able to create a dynamic parameter from this formula. Im not overly familar with SQL so I dont know how to include this exception within the SQL statement.
Many thanks
IanWaterman (Programmer)
24 Jul 12 6:17
Try

SELECT table1.Opp_Id, table1.Objective, table1.Revenue, table1.Name_Type, table4.QuoteNo,
case when table2.Name is null then table1.Name else table2.Name end as CustomerName
FROM ((table1 LEFT OUTER JOIN table3 ON table1.Opp_Id=table3.Opp_Id)
LEFT OUTER JOIN table4 ON table1.Opp_Id= table4.Client_Id)
FULL OUTER JOIN table2 ON table3.Client_Id=table2.Client_Id

Not sure what your database is but there are functions that could be used instead of the Case statement

Oracle
NVL(table2.Name, table1.Name)

SQL server
isnull(table2.Name, table1.Name)
Ian
morles (IS/IT--Management)
24 Jul 12 11:17
Thank you. That worked great.Im using SQL Server. The only issue I seem to have now is that not all the customer names are being displayed when the user is prompted to pick a customer. I set up a dynamic parameter to enable the user to select the relevant customer.

The customers are on the report before it is filtered but there is no option to pick particular customers from the drop down list which users are prompted with. There doesnt seem to be any logical reason for this.

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!

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