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!

Alias Tables and SQL

Status
Not open for further replies.

Sandman71

Technical User
Jun 28, 2001
7
0
0
GB
I have now tried to create several reports using Alias Tables, with very limited success.

I am using Crystal 8.5 with an SQL Database. I have had no such trouble previously when using CRW5, 6 or 7 with a paradox database.

In the latest example, I am trying to print details of a hotel booking using 4 tables.

Table 1 has the Details of the booking, the hotel, the bookee’s ID and his/her guest ID
Table 2 has full details of the main delegate, ID, Name etc
Table 3 has full details of his/her guest, ID, Name etc
Table 4 has details of Dietary Requirements.

I link Table 1 to both Table 2 and Table 3. Table 4, in order to show full details of both the Guest and Bookee’s dietary requirements, has to be inserted twice, once from Table 2 and once from Table 3. I assign the table an Alias to do so.

Now, this is where it gets weird.
I can print out the Bookee Name, Guest Name, and Bookee Dietary requirements. This works fine.

As soon as I insert a field from the Guest Dietary table, it all goes wrong. The guest’s dietary requirements ARE shown, but the list of the bookees dietary requirements changes, and now match those of the guest. This change reverts back to the original (and correct) list if I remove fields from the Alias table.

Any help that could be offered would be much appreciated!!

Many thanks
 
Since my last post, I have used a different ODBC Driver for Interbase. I thought that the driver may have had some effect.
Unfortunately, this has had no effect on the problem.

 
I have now noticed that the SQL is incorrect.
When the query is run in IBConsole, the same data is returned as in Crystal.
Any ideas would be helpful....does Crystal have a bug...or is it me????
 
The description of the query is not very clear to me.
But it sounds like you may need to add a copy of the other 2 tables as alias as well.

You also may want to consider using a View from the SQL database. I have had no problems with using multiple copies of tables using SQL Views.

I hope this helps. Gary Rogers CrystalDesk (Report Scheduler)
Crystal Reports training, consulting, and software interface development.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top