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!

Default Value index field 1

Status
Not open for further replies.

trenttc

Technical User
Joined
Feb 25, 2002
Messages
68
Location
US
T1.txt1 links to T2.txt1 to print the T2.txt2 value. Sometimes T1.txt1 is empty when there should be a default value of 'abc'. Can I set a default value on an index field so when printing I can print the corresponding T2.txt2 value? I would like an option like: File>Report Options>Convert Database Null values to Default of 'abc' for T1.txt1. CR11
 
Hi!
If T2.txt1 always have a value you can try to link T2.txt1 to T1.txt1 instead with a left outer join.

/Goran
 
You will need to create a view on TI, convert the null value of txt1 to 'abc'
You can then join the view of T1 to T2. But then again if you are going to all that trouble you might as well build a view which joins the two tables togther and bring back the data set you want.

If you are not allowed to build views on your database, just write a command to do the data selection for you.

This of course pre-supposes you can write SQL, if you cant then get your DBA to prepare query for your to copy into a Crystal command.

Ian
 
Ian, I have Sybase (no SQL Add Command option) and I can't add a View. Goran, T2.txt1 has the same problem as T1.txt1.
 
If you copy and paste the SQL from the report I can probably modify so that you can create a new report and use it as a command.

My SQL is limited to Oracle or SQL server.

Ian
 
Do you mean to copy what's in Database>Show SQL Query, and then create a new report, pasting the changes into the new report's Database>Show SQL Query?
 
Almost.

You take the SQL created by Crystal from Database>Show SQL Query.

Modify that query to cater for your join requirements. Create a new report but instead of adding tables you add a command. When you go to database expert above tables, views & procedures you will see command. Click that and a new pane opens into which you can paste your query.

However, you will need to be sure that you have all the fields you need on the current report as if not you will need to modify query to add in the new fields required.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top