Print Page | Close Window

Link tables

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2022
Forum Name: Data Connectivity
Forum Discription: How to connect to data sources and export reports
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=1653
Printed Date: 06 Apr 2025 at 7:34pm


Topic: Link tables
Posted By: matt1361
Subject: Link tables
Date Posted: 08 Nov 2007 at 1:39pm
I am trying to link two tables in a DB2 database.  The only fields I can link them with have different data types (data in these fields is identical) and the database expert says link types not compatible. 
 
Is it possible to do this manually?
 
 



Replies:
Posted By: jkwrpc
Date Posted: 08 Nov 2007 at 2:07pm

I do not know DB2 but in TSQL you can convert the data type in a Select statement through CAST or CONVERT functions. If you can in DB2 (I assume you will be able to do this), then convert the data field in one table's  to match the other.

I have done this before and it does solve the problem you are seeing. 
 
Regards,
 
John W.
http://www.CustomReportWriters.net - www.CustomReportWriters.net


Posted By: matt1361
Date Posted: 20 Nov 2007 at 9:15am

That worked great once I got the syntax right. THANKS



Posted By: vijayk
Date Posted: 20 Nov 2007 at 11:06am
matt:
 
Quick question.. Where did you convert it at the database level or within crystal reports..?
 
Thanks
Vijay


Posted By: matt1361
Date Posted: 20 Nov 2007 at 12:02pm
I converted it within crystal reports.  I used the add command feature in the database expert.


Posted By: vijayk
Date Posted: 20 Nov 2007 at 12:33pm
Thanks.. So you wrote your own SQL/Custom SQL rather than crystal generating the SQL for you.
 
Vijay


Posted By: matt1361
Date Posted: 20 Nov 2007 at 4:50pm
Yes but it wasn't in the SQL Expression field that is in the field explorer.  I tried that first.



Print Page | Close Window